diff --git a/crates/voelin-core/src/stream.rs b/crates/voelin-core/src/stream.rs index f385e2c..893bed0 100644 --- a/crates/voelin-core/src/stream.rs +++ b/crates/voelin-core/src/stream.rs @@ -1342,7 +1342,11 @@ mod tests { .await .expect("the layer did not change"); sink.layer_format(0, format(9_000_000)); - tokio::time::sleep(Duration::from_millis(200)).await; + // The stream task takes its commands in order: its answer to this one + // (an error, nobody is viewer 65535) comes after all that the format + // above set going, and nothing is left to wait out. + handles[0].send(StreamCmd::Kick { viewer: u16::MAX }); + wait(&mut rx, |e| matches!(e, Event::Error { session: 1, .. }).then_some(())).await; assert!(!keyframes(), "nothing changed"); handles[0].send(StreamCmd::Stop); }