Skip to content

Commit

Permalink
Improve the error tolerance for drop counter test (#14676)
Browse files Browse the repository at this point in the history
On T0 testbed, sometimes we observed addtional drops which equals to the number of vlan members.
  • Loading branch information
congh-nvidia authored Sep 30, 2024
1 parent 2aa1d5f commit 2a3598c
Showing 1 changed file with 8 additions and 2 deletions.
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

0 comments on commit 2a3598c

Please sign in to comment.