From b038a6328e9b19324a591b4233148086bf863993 Mon Sep 17 00:00:00 2001 From: Chris <156943338+ccroy-arista@users.noreply.github.com> Date: Wed, 20 Nov 2024 20:08:00 -0800 Subject: [PATCH] sonic-mgmt: fix port toggle timeout on many ports (#15573) For topologies leveraging many ports, such as in the case of t0-isolated-d128u128s2, the timeout for non-mellanox fixed-chassis devices is a static value and is too low for the number of ports being configured. In contrast, Mellanox devices use a timeout proportional to the number of ports being toggled. This change moves fixed-chassis broadcom devices to use a proportional timeout as well. --- tests/common/port_toggle.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/common/port_toggle.py b/tests/common/port_toggle.py index 890288394b7..d387c7229d4 100644 --- a/tests/common/port_toggle.py +++ b/tests/common/port_toggle.py @@ -121,14 +121,16 @@ def default_port_toggle_wait_time(duthost, port_count): port_down_wait_time, port_up_wait_time = 120, 180 asic_type = duthost.facts["asic_type"] - if asic_type == "mellanox": + is_modular_chassis = duthost.get_facts().get("modular_chassis") + + if (asic_type == "mellanox") or (asic_type == "broadcom" and not is_modular_chassis): if port_count <= BASE_PORT_COUNT: port_count = BASE_PORT_COUNT port_count_factor = port_count / BASE_PORT_COUNT port_down_wait_time = int(port_down_wait_time * port_count_factor) port_up_wait_time = int(port_up_wait_time * port_count_factor) - elif duthost.get_facts().get("modular_chassis"): + elif is_modular_chassis: port_down_wait_time = 300 port_up_wait_time = 300