[action] [PR:22676] Fix test issue for test_ipv6_bgp_scale.py#23070
Merged
mssonicbld merged 1 commit intosonic-net:202511from Mar 18, 2026
Merged
[action] [PR:22676] Fix test issue for test_ipv6_bgp_scale.py#23070mssonicbld merged 1 commit intosonic-net:202511from
mssonicbld merged 1 commit intosonic-net:202511from
Conversation
Signed-off-by: mssonicbld <[email protected]>
12 tasks
Collaborator
Author
|
Original PR: #22676 |
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.
Summary: Fix test issue for test_ipv6_bgp_scale.py
Fixes # (issue)
calculate_downtime()function. Please see the detail info as belowType of change
Back port request
Approach
What is the motivation for this PR?
The
calculate_downtime()function intest_ipv6_bgp_scale.pyuses[:-1]on themask_rx_cntdict values to exclude the backplane port from the RX total:This is incorrect because
[:-1]removes the last entry by dict insertion order, not the backplane port. The dict insertion order depends on which port first receives a matching packet, which is non-deterministic and varies between runs.In topologies without a backplane (e.g.,
t1-isolated-*),mask_rx_cntcontains only legitimate data port entries and no backplane entry at all. The[:-1]unconditionally removes a valid egress port's counter, causing false packet loss to be reported.For example, in a
test_bgp_admin_flap[1]failure:mask_rx_cnthad exactly 32 entries, all corresponding to BGP neighbor ports (no backplane)[:-1]excluded port(0, 176)(Ethernet176 / ARISTA113T1) which received 1019 packetsmissing_pkt_cnt = 1019anddowntime = 0.4185s, exceeding the 0.2s thresholdThe bug also makes the test flaky — depending on which port happens to be last in the dict, the "missing" count changes, causing random pass/fail results.
How did you do it?
Replaced the fragile
[:-1]approach with explicit backplane port identification usingptf.config['port_map'].When PTF initializes, backplane ports are registered in
ptf.config['port_map']with interface name"backplane"(seeptfadapter/__init__.pyget_ifaces_map()). The new helper_get_backplane_ports()queries this config to find backplane port keys, andcalculate_downtime()excludes only those specific ports from the RX sum.ciscovs-7nodes): backplane ports are correctly identified and excluded_get_backplane_ports()returns an empty set, no ports are excludedHow did you verify/test it?
Run regression test, pass
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation