From 1e3c625d8618e9ee5ba57276abfaa35d7eca4827 Mon Sep 17 00:00:00 2001 From: JJ Liebig Date: Sun, 13 Sep 2026 21:20:22 +0400 Subject: test: deflake federated local input race (#4066) refs #3670 --- tests/client_mode.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/client_mode.rs b/tests/client_mode.rs index 06bd1123..8f326484 100644 --- a/tests/client_mode.rs +++ b/tests/client_mode.rs @@ -808,11 +808,18 @@ fn federated_launch_opens_local_directly_while_saved_ssh_is_unavailable() { || { read_output(&output).contains("Local") } )); let mut input = client._master.as_ref().unwrap().take_writer().unwrap(); - input - .write_all(b"printf 'LOCAL_%s\\n' DIRECT_READY\r") - .unwrap(); + // Input is gated until Local's active surface is ready, and that readiness can lag + // the first rendered frame (the unavailable remote must not extend the wait). Retry + // the write instead of assuming a single write lands, matching the recovered-Local + // path below. assert!(wait_until(Duration::from_secs(10), Duration::from_millis(20), || { - read_output(&output).contains("LOCAL_DIRECT_READY") + if read_output(&output).contains("LOCAL_DIRECT_READY") { + return true; + } + input + .write_all(b"printf 'LOCAL_%s\\n' DIRECT_READY\r") + .unwrap(); + false }), "Local must accept input without waiting for SSH (remote selected: {select_remote}): {}", read_output(&output)); let text = read_output(&output); assert!(!text.contains("Local: connecting"), "{text}"); -- cgit v1.2.3