Fix pktgen port selection for counters#25484
Open
xwjiang-ms wants to merge 1 commit into
Open
Conversation
Filter pktgen candidate ports to ports present in show interface counter output before randomly selecting a port. This prevents KeyError when minigraph contains a port that does not appear in int_counter on dualtor master testbeds. Signed-off-by: xwjiang-ms <xiaweijiang@microsoft.com>
Collaborator
|
/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:
Fix
test_pktgenon topologies whereminigraph_portsincludes ports that are not present inshow interface counteroutput. The test randomly selected such a port and then raisedKeyErrorwhile indexingint_counter[port].Type of change
Back port request
Approach
What is the motivation for this PR?
SONiC nightly master PBI 38502282 reports consistent
test_pktgenfailures on Arista dualtor withKeyError: 'Ethernet...'at the interface-counter verification step.How did you do it?
Filter the packet-generation candidate port list to ports present in
duthost.show_interface(command="counter")['ansible_facts']['int_counter']before selecting a random port. The existing no-port skip remains effective if no counter-backed data ports are available.How did you verify/test it?
python -m py_compile tests/test_pktgen.pyint_counter[port], so selecting only keys present inint_counterprevents the observedKeyErrorwhile preserving the counter verification.Any platform specific information?
Observed on Arista-7260CX3-D108C8 dualtor master nightly.
Supported testbed topology if it's a new test case?
N/A
Documentation
N/A