Skip to content

Commit 77df1a6

Browse files
committed
tests: relax tests for CI
1 parent eeb9efd commit 77df1a6

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

test/event_test.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,14 @@ TEMPLATE_TEST_CASE( "auto_reset_event implementations",
492492
// Signal n times — each signal should wake exactly one thread.
493493
for ( unsigned i = 0; i < n; ++i ) {
494494
ev.signal();
495-
std::this_thread::sleep_for( 5ms );
495+
// Spin-wait for the woken thread to increment the counter.
496+
// A fixed sleep is insufficient on loaded CI runners.
497+
auto deadline = std::chrono::steady_clock::now() + 2s;
498+
while ( woken.load( std::memory_order_acquire ) != int( i + 1 ) ) {
499+
if ( std::chrono::steady_clock::now() > deadline )
500+
break;
501+
std::this_thread::sleep_for( 1ms );
502+
}
496503
REQUIRE( woken.load() == int( i + 1 ) );
497504
}
498505

0 commit comments

Comments
 (0)