mirror of
https://github.com/VallierDev/uu-remote-linux.git
synced 2026-11-16 08:50:40 +01:00
test: keep waiting for the listed session's LIST_RESP on the binary channel (#216)
locked_control_unlock_requests_and_tools_work_without_a_video_frame broke out of its wait loop on the first BINARY_DATA_CHANNEL message and unwrapped terminal::decode on it. The process-global terminal change watch also sends the field-28 list-invalidated notification on that channel (terminal::changed_message, an initialization::envelope with an empty field 28), which is not a TERM frame, so decode returns None. Any concurrently running test that opens, kills or reconciles a terminal session can broadcast it inside this test's wait window, and the suite panics at desktop_control_tests.rs:302. Skip messages that do not decode and keep waiting until the LIST_RESP of the session being listed (71, then 72) arrives, following the sibling terminal test in webrtc_lifecycle_tests.rs. Test-only change.
This commit is contained in:
1 parent
fe052cdca7
commit
890c46e280
1 file changed
+20
-2
@@ -243,7 +243,16 @@ async fn locked_control_unlock_requests_and_tools_work_without_a_video_frame() {
|
||||
let frame = tokio::time::timeout(Duration::from_secs(5), async {
|
||||
loop {
|
||||
let (channel, message) = terminal_viewer.messages.recv().await.unwrap();
|
||||
if channel == "BINARY_DATA_CHANNEL" { break crate::terminal::decode(&message).unwrap(); }
|
||||
if channel != "BINARY_DATA_CHANNEL" {
|
||||
continue;
|
||||
}
|
||||
// The process-global terminal change watch also broadcasts the field-28
|
||||
// list-invalidated notification here, which is not a TERM frame.
|
||||
if let Some(frame) = crate::terminal::decode(&message) {
|
||||
if frame.kind == crate::terminal::LIST_RESP && frame.session == 71 {
|
||||
break frame;
|
||||
}
|
||||
}
|
||||
}
|
||||
}).await.unwrap();
|
||||
assert_eq!((frame.kind, frame.session), (crate::terminal::LIST_RESP, 71));
|
||||
@@ -299,7 +308,16 @@ async fn locked_control_unlock_requests_and_tools_work_without_a_video_frame() {
|
||||
let frame = tokio::time::timeout(Duration::from_secs(5), async {
|
||||
loop {
|
||||
let (channel, message) = terminal_viewer.messages.recv().await.unwrap();
|
||||
if channel == "BINARY_DATA_CHANNEL" { break crate::terminal::decode(&message).unwrap(); }
|
||||
if channel != "BINARY_DATA_CHANNEL" {
|
||||
continue;
|
||||
}
|
||||
// The process-global terminal change watch also broadcasts the field-28
|
||||
// list-invalidated notification here, which is not a TERM frame.
|
||||
if let Some(frame) = crate::terminal::decode(&message) {
|
||||
if frame.kind == crate::terminal::LIST_RESP && frame.session == 72 {
|
||||
break frame;
|
||||
}
|
||||
}
|
||||
}
|
||||
}).await.unwrap();
|
||||
assert_eq!((frame.kind, frame.session), (crate::terminal::LIST_RESP, 72));
|
||||
|
||||
Reference in new issue
Block a user