Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the error tolerance for drop counters test #14676

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions tests/common/helpers/drop_counters/drop_counters.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,16 @@ def _check_drops_on_dut():

if not wait_until(25, 1, 0, _check_drops_on_dut):
# We were seeing a few more drop counters than expected, so we are allowing a small margin of error
DEOP_MARGIN = 10
# The max number of unexpected drop we see equals to the number of vlan members in t0 topology
duthost = duthosts.frontend_nodes[0]
mg_facts = duthost.minigraph_facts(host=duthost.hostname)["ansible_facts"]
DROP_MARGIN = 0 if mg_facts['minigraph_vlans'] else 10
for vlan in mg_facts['minigraph_vlans']:
DROP_MARGIN += len(mg_facts['minigraph_vlans'][vlan]['members'])
logger.info(f"The DROP_MARGIN is {DROP_MARGIN}")
actual_drop = _get_drops_across_all_duthosts()
for drop in actual_drop:
if drop >= packets_count and drop <= packets_count + DEOP_MARGIN:
if drop >= packets_count and drop <= packets_count + DROP_MARGIN:
logger.warning("Actual drops {} exceeded expected drops {} on iface {}\n".format(
actual_drop, packets_count, dut_iface))
break
Expand Down
Loading