Skip to content

Commit 0f02c51

Browse files
Ashutosh Grewalfacebook-github-bot
authored andcommitted
Introduce a command line arg to delay agent exit
Summary: Certains tests, e.g. `forceIsolateDuringWarmBoot()` require that an operation (firmware isolate) happen while the cold boot binaries have unregistered SDK callbacks but warmboot binaries have not started. In mono, this is simple, as the test can add additional delay after sdk callbacks for mono binary are unregistered https://www.internalfb.com/code/fbsource/[2f9795f95bf2217920103973faf3977373ccbb12]/fbcode/fboss/agent/test/agent_hw_tests/AgentVoqSwitchFirmwareTests.cpp?lines=255-258 This approach doesn't work for multi-switch mode, as the test binary where the `std::atexit()` runs doesn't control the h/w agent. The h/w agent is stopped afterwords and it's callbacks are not unregistered by the the time fw isolation happens. Solution ===== Introduce a command line arg, that will be set by the test-fixture to delay h/w agent exiting in multi-switch mode or monolith-agent in mono mode NOTE: I had implemented (diff stack D74945168) a netcastle based delay between s/w and h/w agents for such tests. However, shri-khare and jasmeetbagga mentioned that it won't work for OSS. This new logic is jasmeetbagga's suggestion. Differential Revision: D75363390 fbshipit-source-id: 0835e6a37a3b7886233539db798aae37491040ab
1 parent 4e736fe commit 0f02c51

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

fboss/agent/AgentFeatures.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,3 +306,5 @@ DEFINE_bool(
306306
update_route_with_dlb_type,
307307
false,
308308
"Flag to perform a DLB type update in FIB state");
309+
310+
DEFINE_int32(agent_exit_delay_s, 0, "Delay in seconds before the agent exits");

fboss/agent/AgentFeatures.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,4 @@ DECLARE_int32(ecmp_resource_manager_make_before_break_buffer);
104104

105105
DECLARE_int32(update_stats_interval_s);
106106
DECLARE_bool(update_route_with_dlb_type);
107+
DECLARE_int32(agent_exit_delay_s);

0 commit comments

Comments
 (0)