diff --git a/tests/dualtor/test_ipinip.py b/tests/dualtor/test_ipinip.py index 15ed332782..a8c10e71d3 100644 --- a/tests/dualtor/test_ipinip.py +++ b/tests/dualtor/test_ipinip.py @@ -24,7 +24,7 @@ from tests.common.dualtor.mux_simulator_control import toggle_all_simulator_ports_to_rand_unselected_tor # noqa F401 from tests.common.dualtor.tunnel_traffic_utils import tunnel_traffic_monitor # noqa F401 from tests.common.helpers.assertions import pytest_require -from tests.common.utilities import is_ipv4_address, wait_until +from tests.common.utilities import is_ipv4_address, wait_until, wait from tests.common.fixtures.ptfhost_utils import run_icmp_responder # noqa F401 from tests.common.fixtures.ptfhost_utils import run_garp_service # noqa F401 from tests.common.fixtures.ptfhost_utils import change_mac_addresses # noqa F401 @@ -115,7 +115,7 @@ def stop_garp(ptfhost): if is_t0_mocked_dualtor(tbinfo): # noqa F405 request.getfixturevalue('apply_active_state_to_orchagent') - time.sleep(30) + wait(60, 'wait for config push/mux state change on mocked dualtor') else: request.getfixturevalue('toggle_all_simulator_ports_to_rand_selected_tor') diff --git a/tests/dualtor/test_orchagent_standby_tor_downstream.py b/tests/dualtor/test_orchagent_standby_tor_downstream.py index 7685868131..0dc07ab8bb 100644 --- a/tests/dualtor/test_orchagent_standby_tor_downstream.py +++ b/tests/dualtor/test_orchagent_standby_tor_downstream.py @@ -24,7 +24,7 @@ from tests.common.dualtor.server_traffic_utils import ServerTrafficMonitor from tests.common.dualtor.mux_simulator_control import toggle_all_simulator_ports # noqa: F401 from tests.common.dualtor.tor_failure_utils import shutdown_bgp_sessions # noqa: F401 -from tests.common.utilities import wait_until +from tests.common.utilities import wait_until, wait pytestmark = [ @@ -360,7 +360,7 @@ def monitor_tunnel_and_server_traffic(torhost, expect_tunnel_traffic=True, expec logger.info("Step 1.1: Add route to a nexthop which is a standby Neighbor") set_mux_state(rand_selected_dut, tbinfo, 'standby', tor_mux_intfs, toggle_all_simulator_ports) add_nexthop_routes(rand_selected_dut, random_dst_ip, nexthops=[target_server]) - time.sleep(30) + wait(60, 'wait for config push/mux state change on mocked dualtor') logger.info("Step 1.2: Verify traffic to this route dst is forwarded to Active ToR and equally distributed") check_tunnel_balance(**test_params) monitor_tunnel_and_server_traffic(rand_selected_dut, expect_server_traffic=False, expect_tunnel_traffic=True) @@ -368,14 +368,14 @@ def monitor_tunnel_and_server_traffic(torhost, expect_tunnel_traffic=True, expec logger.info("Stage 2: Verify Active Forwarding") logger.info("Step 2.1: Simulate Mux state change to active") set_mux_state(rand_selected_dut, tbinfo, 'active', tor_mux_intfs, toggle_all_simulator_ports) - time.sleep(30) + wait(60, 'wait for config push/mux state change on mocked dualtor') logger.info("Step 2.2: Verify traffic to this route dst is forwarded directly to server") monitor_tunnel_and_server_traffic(rand_selected_dut, expect_server_traffic=True, expect_tunnel_traffic=False) logger.info("Stage 3: Verify Standby Forwarding Again") logger.info("Step 3.1: Simulate Mux state change to standby") set_mux_state(rand_selected_dut, tbinfo, 'standby', tor_mux_intfs, toggle_all_simulator_ports) - time.sleep(30) + wait(60, 'wait for config push/mux state change on mocked dualtor') logger.info("Step 3.2: Verify traffic to this route dst \ is now redirected back to Active ToR and equally distributed") monitor_tunnel_and_server_traffic(rand_selected_dut, expect_server_traffic=False, expect_tunnel_traffic=True)