From f0200063aee0287a8326018eccf1b8ec954cbee9 Mon Sep 17 00:00:00 2001 From: Song Yuan <64041228+ysmanman@users.noreply.github.com> Date: Fri, 3 Jan 2025 17:37:14 -0800 Subject: [PATCH] Make test_idf_isolated_withdraw_all more robust (#16271) 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. --- tests/bgp/test_seq_idf_isolation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/bgp/test_seq_idf_isolation.py b/tests/bgp/test_seq_idf_isolation.py index 9d236b0ecb2..75c57c613e4 100644 --- a/tests/bgp/test_seq_idf_isolation.py +++ b/tests/bgp/test_seq_idf_isolation.py @@ -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")