diff options
| author | JJ Liebig <jonathan.liebig@gmail.com> | 2026-09-13 21:20:22 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-13 19:20:22 +0200 |
| commit | 1e3c625d8618e9ee5ba57276abfaa35d7eca4827 (patch) | |
| tree | 0077e74fc14b13b59cbe2a7c8a1a30648f41fb62 /tests | |
| parent | 3834fd3d0f77a809cf3e394fca31fd036d3173dd (diff) | |
test: deflake federated local input race (#4066)
refs #3670
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/client_mode.rs | 15 |
1 files changed, 11 insertions, 4 deletions
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}"); |
