Skip to content

Commit 62e2f60

Browse files
committed
fix(test): add worker initialization delay for sanitizer stability
Add brief sleep after pool start in AutoscalerTest::SetUp to ensure all workers are fully initialized before assertions. Under sanitizer overhead, worker threads may not have entered their run loop yet, causing get_active_worker_count to return fewer workers than enqueued.
1 parent 5750983 commit 62e2f60

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/unit/thread_base_test/autoscaler_test.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ class AutoscalerTest : public ::testing::Test {
190190

191191
pool_->start();
192192

193+
// Allow workers to fully initialize under sanitizer
194+
std::this_thread::sleep_for(std::chrono::milliseconds(50));
195+
193196
// Create autoscaling policy
194197
policy_.min_workers = 2;
195198
policy_.max_workers = 8;

0 commit comments

Comments
 (0)