Let the stream task say when it is done in the layer-format test

layer_formats_reach_the_live_stream sent the same layer format a second time
and then slept 200 ms before asserting that no keyframe was asked for, which
tests that the stream task had not got to the command within 200 ms. It is the
task that asks for a keyframe (when the layer's bitrate changes) and it takes
its commands in the order they are sent, from the sink and from the handle
through the same channel. The test now sends a command whose answer is an
error event (Kick of a viewer, 65535, that is none) and waits for that
event: it comes after everything the format set going, and nothing is left to
wait out. A keyframe request the viewer's side makes late is not covered, and
none was seen.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Sonnet 5.5 committed 2026-10-25 03:26:33 +03:00
1 parent c5bb74ffcb
commit 77304604fe
1 file changed
+5 -1
+5 -1
View File
@@ -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);
}