Skip to content

Commit

Permalink
Back out "Fix speed change test to copy config at CB"
Browse files Browse the repository at this point in the history
Summary:
setupconfigflag() is called before initAgent @ https://www.internalfb.com/code/fbsource/[9073b8e652ad23e5f47d8b58629146d6e9007c9c]/fbcode/fboss/agent/test/AgentTest.cpp?lines=52

And only in initAgent, Swswitch::Init is called which setups the bootype_ as warmboot or cold boot. Hence sw()->getBootType() will not be equal to Cold boot when checked inside setupconfigflag()

This causes speed change tests to fail. Backout and fix it using file check

Reviewed By: zechengh09

Differential Revision: D62063174

fbshipit-source-id: e86e2baa1bb3bb1f8cd92e9cbd7706cc0e2b6e6f
  • Loading branch information
elangovan911-meta authored and facebook-github-bot committed Aug 31, 2024
1 parent d94abd2 commit 43cd832
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fboss/agent/test/link_tests/SpeedChangeTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,9 @@ void SpeedChangeTest::setupConfigFlag() {
originalConfigCopy =
linkTestDir + "/agent_speed_change_test_original_config.conf";

// Create a copy of the original config during coldboot
if (sw()->getBootType() == BootType::COLD_BOOT) {
// Create a copy of the original config if we haven't created one before.
if (!boost::filesystem::exists(originalConfigCopy)) {
// Likely a coldboot iteration
utilCreateDir(linkTestDir);
boost::filesystem::copy_file(FLAGS_config, originalConfigCopy);
}
Expand Down

0 comments on commit 43cd832

Please sign in to comment.