File tree Expand file tree Collapse file tree
sdks/rust/tests/test-counter/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -131,9 +131,12 @@ impl TestCounter {
131131 const WAIT_INTERVAL_MS : u32 = 10 ;
132132 const MAX_WAIT_ITERATIONS : u32 = ( TEST_TIMEOUT_SECS as u32 * 1000 ) / WAIT_INTERVAL_MS ;
133133
134- // On wasm/web the SDK message loop runs on the same single-threaded event loop
135- // as test code. Blocking on a Condvar here can deadlock callbacks forever.
136- // We poll with timer yields so websocket/callback tasks can continue to run.
134+ // Native can block on a Condvar because callbacks keep moving on a different SDK thread.
135+ // wasm/web does not have that escape hatch in this harness: the websocket/message loop and
136+ // the test body share the same single-threaded JS event loop, so blocking here would stop
137+ // callback delivery entirely. We poll with timer yields so websocket/callback tasks can
138+ // continue to run, and then do the same final pass native uses to convert recorded failures
139+ // into a panic.
137140 let all_tests_finished = || {
138141 let inner = self . inner . lock ( ) . expect ( "TestCounterInner Mutex is poisoned" ) ;
139142 inner. outcomes . len ( ) == inner. registered . len ( )
You can’t perform that action at this time.
0 commit comments