Skip to content

Commit 9d5dbfc

Browse files
committed
fix(tests): reduce timeout flakes in linux-sandbox and tui
1 parent eba5333 commit 9d5dbfc

2 files changed

Lines changed: 13 additions & 7 deletions

File tree

code-rs/linux-sandbox/tests/suite/landlock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const SHORT_TIMEOUT_MS: u64 = 200;
1919
const SHORT_TIMEOUT_MS: u64 = 5_000;
2020

2121
#[cfg(not(target_arch = "aarch64"))]
22-
const LONG_TIMEOUT_MS: u64 = 1_000;
22+
const LONG_TIMEOUT_MS: u64 = 2_000;
2323
#[cfg(target_arch = "aarch64")]
2424
const LONG_TIMEOUT_MS: u64 = 5_000;
2525

code-rs/tui/tests/stuck_exec.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -668,12 +668,18 @@ fn queued_exec_end_flushes_after_stream_clears() {
668668
harness.force_stream_clear();
669669

670670
// Give the flush timers enough headroom under nextest parallelism.
671-
std::thread::sleep(Duration::from_millis(400));
672-
harness.flush_into_widget();
673-
std::thread::sleep(Duration::from_millis(200));
674-
harness.flush_into_widget();
675-
676-
let output = render_chat_widget_to_vt100(&mut harness, 80, 14);
671+
let deadline = Instant::now() + Duration::from_secs(2);
672+
let output = loop {
673+
std::thread::sleep(Duration::from_millis(100));
674+
harness.flush_into_widget();
675+
let output = render_chat_widget_to_vt100(&mut harness, 80, 14);
676+
if output.contains("queued") && !output.contains("Running...") {
677+
break output;
678+
}
679+
if Instant::now() >= deadline {
680+
break output;
681+
}
682+
};
677683
assert!(
678684
output.contains("queued"),
679685
"exec output should render after the deferred end is delivered:\n{}",

0 commit comments

Comments
 (0)