Ladakh800bcls: fixup HwSwitchMatcher exception in AgentNeighborTest* #778
+7
−4
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.
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit installpre-commit run#pre-commit run
clang-format.............................................................Passed
black................................................(no files to check)Skipped
shellcheck...........................................(no files to check)Skipped
shfmt................................................(no files to check)Skipped
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check json...........................................(no files to check)Skipped
check for merge conflicts................................................Passed
ruff check...........................................(no files to check)Skipped
Summary
Desciption:
AgentNeighborTest* failed with following exception
C++ exception with description "HwSwitchMatcher::switchId api must be called only when there is a single switchId" thrown in the test body.
Root Cause:
On multi NPU platform, in function facebook::fboss::utility::NeighborInfo getNeighborInfo, when calling following
auto switchId = ensemble.getSw()
->getScopeResolver()
->scope(ensemble.masterLogicalPortIds())
.switchId();
scope(ensemble.masterLogicalPortIds()) returns an array, so can't get switchId().
Fix:
As this function is designed to retrieve the current state of neighbor entry for a specific interfaceId directly from the ASIC, so changed to get the switchId based on the interfaceId information.
Test Plan
rerun all tests of AgentNeighborTest1/3/5/7* and PASSED, AgentNeighborTest0/2/4/6 failed with other errors, will fix and track with other PR
log.tar.gz