Skip to content

Commit

Permalink
Fix AgentFabricSwitchTests.checkFabricConnectivityStats test
Browse files Browse the repository at this point in the history
Summary:
We are resetting expected connectivity so we should expect
Missing connectivity == num fabric ports
Mismatched connectivity == 0
Adjust the expectation.
Also rather than calculating this via utility, simply use the
FabricConnectityStats from SwSwitch to do so. This tests more
of our prod code

Reviewed By: shri-khare

Differential Revision: D61421396

fbshipit-source-id: b64921c8072901670f26c3a75e403c1c0498b423
  • Loading branch information
Jasmeet Bagga authored and facebook-github-bot committed Aug 17, 2024
1 parent 062895b commit b62fd28
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions fboss/agent/test/agent_hw_tests/AgentFabricSwitchTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,13 @@ TEST_F(AgentFabricSwitchTest, checkFabricConnectivityStats) {
};
auto verify = [this]() {
EXPECT_GT(getProgrammedState()->getPorts()->numNodes(), 0);
for (const auto& switchId : getFabricSwitchIdsWithPorts()) {
utility::checkFabricConnectivityStats(getAgentEnsemble(), switchId);
}
WITH_RETRIES({
auto reachabilityStats = getAgentEnsemble()->getFabricReachabilityStats();
EXPECT_EVENTUALLY_EQ(
reachabilityStats.missingCount(),
masterLogicalFabricPortIds().size());
EXPECT_EVENTUALLY_EQ(reachabilityStats.mismatchCount(), 0);
});
};
verifyAcrossWarmBoots(setup, verify);
}
Expand Down

0 comments on commit b62fd28

Please sign in to comment.