From 890c46e28048ee950ddadb612749a0e5eb8d8c0f Mon Sep 17 00:00:00 2001 From: Kitlee0252 <152352402+Kitlee0252@users.noreply.github.com> Date: Thu, 12 Nov 2026 13:08:51 +0800 Subject: [PATCH] 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. --- src/desktop_control_tests.rs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/desktop_control_tests.rs b/src/desktop_control_tests.rs index 4344ae2..0e6ba9c 100644 --- a/src/desktop_control_tests.rs +++ b/src/desktop_control_tests.rs @@ -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));