Fix ASIC check in test_pfcwd_function#16535
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@rbpittman Can you help review? Thanks |
|
Cherry-pick PR to 202405: #16539 |
Co-authored-by: bingwang-ms <[email protected]>
|
Cherry-pick PR to 202411: #16540 |
These changes are picked up in this merge c74b051 (upstream/202405) Fix the test_nhop_group nexthop map for ld DUTs (sonic-net#16166) 3850e85 [dualtor] Fix `testFdbMacLearning` (sonic-net#16549) 4c5b264 Stabilize `test_snmp_fdb_send_tagged` (sonic-net#16409) 9b999f7 Fix ASIC check in test_pfcwd_function (sonic-net#16535) (sonic-net#16539)
|
@bingwang-ms : This causes the failure: |
@rbpittman Can you please check this? Seems the variable is not defined in some code path for Cisco platform. |
|
@rraghav-cisco The root cause is below code is not reachable due to syntax issue in PR #15772 . This PR fixed the issue and the the sonic-mgmt/tests/pfcwd/test_pfcwd_function.py Line 760 in 976fc8c |
|
@bingwang-ms I think the intended order for all branches would be something like: If the 2 conditions are needed (1 for variable definitions and another for the state checking in the loop), I'd suggest to merge the boolean condition into a variable, such as: should_wait = dut.facts['asic_type'] in ["mellanox", "cisco-8000"]
if should_wait:
PFC_STORM...
...
if should_wait:
pytest_assert...might help prevent more issues on this in the future. |
Yeah, makes sense to me. Could you please do the change? |
|
I can, though it'll take me some time to revector and get a TB setup for validation. |
Description of PR Summary: Fixes the following error per discussion in sonic-net#16535 UnboundLocalError: local variable 'PFC_STORM_TIMEOUT' referenced before assignment
Description of PR
Summary:
The issue was introduced by PR #15772
The ASIC check is not working as expected because of the syntax error in the code. It should be
ininstead of==sonic-mgmt/tests/pfcwd/test_pfcwd_function.py
Line 757 in 21dbd80
The issue will cause PFCWD function not stable on some platform.
Type of change
Back port request
Approach
What is the motivation for this PR?
This PR is to fix a syntax issue in
test_pfcwd_function.py.How did you do it?
Fix the syntax.
How did you verify/test it?
The change is verified on a physical testbed.
Any platform specific information?
No.
Supported testbed topology if it's a new test case?
Not a new test.
Documentation