Skip to content

Commit

Permalink
Modify AgentEnsembleTest and AgentHwTest teardown to check for warmbo…
Browse files Browse the repository at this point in the history
…ot flag

Summary:
Currently, all of Agent Hw test relies on verifyAcrosswarmboots and so they dont worry about the TearDown implementation.

If any test relied on AgentHwTest or AgentEnsembleTest teardown, then they wont be able to support warmboot because it always exits in an non graceful manner.

Modify AgentEnsembleTest and AgentHwTest teardown to check for warmboot flag and pass in option to exit gracefully

Reviewed By: zechengh09

Differential Revision: D60946407

fbshipit-source-id: 2b4064a13ee403e2d8750c23252dc956acbdf394
  • Loading branch information
elangovan911-meta authored and facebook-github-bot committed Aug 14, 2024
1 parent 495b8b3 commit 6ba2532
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion fboss/agent/test/AgentEnsembleTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ void AgentEnsembleTest::TearDown() {
(::testing::Test::HasFailure() && FLAGS_run_forever_on_failure)) {
runForever();
}
tearDownAgentEnsemble();
if (FLAGS_setup_for_warmboot &&
isSupportedOnAllAsics(HwAsic::Feature::WARMBOOT)) {
XLOG(DBG2) << "tearDownAgentEnsemble() for warmboot";
tearDownAgentEnsemble(true);
} else {
tearDownAgentEnsemble();
}
}

void AgentEnsembleTest::tearDownAgentEnsemble(bool doWarmboot) {
Expand Down

0 comments on commit 6ba2532

Please sign in to comment.