File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
crates/codirigent-session/src Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1033,13 +1033,17 @@ mod tests {
10331033 . expect ( "timeout" )
10341034 . expect ( "channel closed" ) ;
10351035 assert_eq ! ( & received, data) ;
1036- assert ! ( chunk_called. load( Ordering :: SeqCst ) , "on_chunk should fire" ) ;
10371036
10381037 // Wait for channel to close (reader thread hit EOF and exited)
10391038 while rx. recv ( ) . await . is_some ( ) { }
10401039
10411040 // Give the thread a moment to run on_exit after the loop
10421041 tokio:: time:: sleep ( std:: time:: Duration :: from_millis ( 100 ) ) . await ;
1042+
1043+ // Check both flags after the thread has fully exited, since on_chunk
1044+ // is called *after* the channel send and may not have run yet when
1045+ // rx.recv() returns.
1046+ assert ! ( chunk_called. load( Ordering :: SeqCst ) , "on_chunk should fire" ) ;
10431047 assert ! (
10441048 exit_called. load( Ordering :: SeqCst ) ,
10451049 "on_exit should fire on EOF"
You can’t perform that action at this time.
0 commit comments