[action] [PR:22173] Reduce continuous link flap test runtime by sampling 32 interfaces per iteration with completeness level#22480
Merged
mssonicbld merged 1 commit intosonic-net:202511from Feb 20, 2026
Conversation
…r iteration with completeness level (sonic-net#22173) Why: The continuous link flap test can take a long time on devices/testbeds with many connected ports because it flaps every eligible interface on both DUT and peer across 3 iterations. During msft runs it failed after 3 hours and during nvidia runs it failed after 9 hours. How: - Added a helper get_random_candidates(...) that builds the full candidate list (admin up + present in connection graph), randomly samples up to 32 candidates, and logs the selected ports for traceability. - Updated the DUT flap loop to call port_toggle(..., ports=selected_ports, wait_after_ports_up=30, ...) so only the sampled ports are flapped each iteration. - Updated the peer flap loop to only toggle links for the sampled (dut_port, fanout, fanout_port) tuples. Tested: Ran test_cont_link_flap and confirmed the test executes successfully, only the sampled ports are toggled (validated via logs), and runtime is reduced compared to flapping all ports. Signed-off-by: Priyansh Tratiya <[email protected]> Signed-off-by: mssonicbld <[email protected]>
11 tasks
Collaborator
Author
|
Original PR: #22173 |
Collaborator
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
Summary:
Reduce
test_cont_link_flapruntime by flapping a randomly sampled subset (up to 32) of DUT ports and corresponding peer (fanout) ports per iteration, instead of iterating over all connected ports.Type of change
Back port request
Approach
What is the motivation for this PR?
The continuous link flap test can take a long time on devices/testbeds with many connected ports because it flaps every eligible interface on both DUT and peer across 3 iterations. During msft runs it failed after 3 hours and during nvidia runs it failed after 9 hours. The idea is that if it passes for 32 random interfaces across 3 iterations, it will pass overall. This PR aims to keep coverage representative while significantly lowering overall test execution time.
How did you do it?
get_random_candidates(...)that:port_toggle(..., ports=selected_ports, wait_after_ports_up=30, ...)so only the sampled ports are flapped each iteration.How did you verify/test it?
tests/platform_tests/link_flap/test_cont_link_flap.py::test_cont_link_flapand confirmed:Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation