From b62fd281c16dcfac907bf344aca1a2af28e541eb Mon Sep 17 00:00:00 2001 From: Jasmeet Bagga Date: Fri, 16 Aug 2024 20:56:59 -0700 Subject: [PATCH] Fix AgentFabricSwitchTests.checkFabricConnectivityStats test 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 --- .../test/agent_hw_tests/AgentFabricSwitchTests.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fboss/agent/test/agent_hw_tests/AgentFabricSwitchTests.cpp b/fboss/agent/test/agent_hw_tests/AgentFabricSwitchTests.cpp index efd3568a94e0e..6c653b0d5d202 100644 --- a/fboss/agent/test/agent_hw_tests/AgentFabricSwitchTests.cpp +++ b/fboss/agent/test/agent_hw_tests/AgentFabricSwitchTests.cpp @@ -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); }