Fix initialization and destruction order in StopConditionTest. Declaring stop_testing before the ThreadPool requesters ensures that the background threads do not access stop_testing before it is initialized or after it is destroyed. PiperOrigin-RevId: 964834504
diff --git a/centipede/stop_test.cc b/centipede/stop_test.cc index b2abd6a..476b5e7 100644 --- a/centipede/stop_test.cc +++ b/centipede/stop_test.cc
@@ -105,8 +105,8 @@ TEST(StopConditionTest, ConcurrentStopRequests) { StopCondition stop_condition; - ThreadPool requesters(2); std::atomic<bool> stop_testing = false; + ThreadPool requesters(2); requesters.Schedule([&] { while (!stop_testing) { stop_condition.RequestStop(/*exit_code=*/1234,