Skip to content

Commit cdca558

Browse files
committed
Fix incorrect route delete polling threshold in test_crm_route
Issue: PR sonic-net#22132 introduced a polling check after route deletion with an incorrect threshold: `crm_stats_route_used - total_routes`. This subtracts `total_routes` added from the initial baseline `crm_stats_route_used`, but the test only deletes routes it previously added, so the counter should return to the baseline — not below it. The bug is masked when total_routes = 1 (most platforms) but fails on broadcom-dnx devices where total_routes = 64. Fix: Change the threshold to `crm_stats_route_used + CRM_COUNTER_TOLERANCE` so the polling correctly waits for the counter to return to approximately the initial baseline value, consistent with the final assertion. Signed-off-by: setu <setu@arista.com>
1 parent 7faa728 commit cdca558

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tests/crm/test_crm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ def check_route_added():
751751

752752
# Make sure CRM counters updated - use polling to wait for route counter to update
753753
logger.info(f"Waiting for route counters to update after deleting {total_routes} routes...")
754-
expected_max_used = crm_stats_route_used - total_routes + CRM_COUNTER_TOLERANCE
754+
expected_max_used = crm_stats_route_used + CRM_COUNTER_TOLERANCE
755755

756756
def check_route_deleted():
757757
return get_route_used() <= expected_max_used

0 commit comments

Comments
 (0)