From 97f8fb4ae56ab985315ffa4f9a4f9b42bd5f6e2d Mon Sep 17 00:00:00 2001 From: Dashuai Zhang <164845223+sdszhang@users.noreply.github.com> Date: Wed, 22 Jan 2025 17:42:08 +1100 Subject: [PATCH] fix syntax error. (#16631) --- tests/pfcwd/test_pfcwd_function.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/pfcwd/test_pfcwd_function.py b/tests/pfcwd/test_pfcwd_function.py index 1657843a33..8ccdf9b795 100644 --- a/tests/pfcwd/test_pfcwd_function.py +++ b/tests/pfcwd/test_pfcwd_function.py @@ -734,7 +734,8 @@ def storm_detect_path(self, dut, port, action): test_ports_info = {self.pfc_wd['rx_port'][0]: self.pfc_wd} queues = [self.storm_hndle.pfc_queue_idx] - if dut.facts['asic_type'] == "mellanox": + extra_pfc_storm_timeout_needed = dut.facts['asic_type'] in ["mellanox", "cisco-8000"] + if extra_pfc_storm_timeout_needed: PFC_STORM_TIMEOUT = 30 pfcwd_stats_before_test = check_pfc_storm_state(dut, port, self.storm_hndle.pfc_queue_idx) @@ -754,8 +755,8 @@ def storm_detect_path(self, dut, port, action): if self.pfc_wd['fake_storm']: PfcCmd.set_storm_status(dut, self.queue_oid, "enabled") - if dut.facts['asic_type'] in ["mellanox", "cisco-8000"]: - # On Mellanox platform, more time is required for PFC storm being triggered + if extra_pfc_storm_timeout_needed: + # On Mellanox and Cisco platform, more time is required for PFC storm being triggered # as PFC pause sent from Non-Mellanox leaf fanout is not continuous sometimes. pytest_assert(wait_until(PFC_STORM_TIMEOUT, 2, 0, lambda: check_pfc_storm_state(dut, port, self.storm_hndle.pfc_queue_idx) != pfcwd_stats_before_test), # noqa: E501, E128