Skip to content

Commit

Permalink
Make test_idf_isolated_withdraw_all more robust (#16271)
Browse files Browse the repository at this point in the history
The test is flaky because it checks routes on neighbors immediately after isolating dut. So the test may fail if the neighbors (VM) are not able to process route withdraw in time. Make the test more robust by retrying validation for 60 seconds.
  • Loading branch information
ysmanman authored Jan 4, 2025
1 parent 8043026 commit f020006
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/bgp/test_seq_idf_isolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ def test_idf_isolated_withdraw_all(duthosts, rand_one_downlink_duthost,
# Verify DUT is in isolated-withdraw-all state.
pytest_assert(IDF_ISOLATED_WITHDRAW_ALL == get_idf_isolation_state(duthost),
"DUT is not in isolated_withdraw_all state")
pytest_assert(verify_only_loopback_routes_are_announced_to_neighs(duthosts, duthost, nbrs,
traffic_shift_community),
"Failed to verify only loopback route in isolated_withdraw_all state")
if not wait_until(60, 3, 0, verify_only_loopback_routes_are_announced_to_neighs,
duthosts, duthost, nbrs, traffic_shift_community):
pytest.fail("Failed to verify only loopback route in isolated_withdraw_all state")
finally:
# Recover to unisolated state
duthost.shell("sudo idf_isolation unisolated")
Expand Down

0 comments on commit f020006

Please sign in to comment.