Skip to content

Commit b365cab

Browse files
committed
test(tail): fix flaky test_follow_name_multiple on macOS
Increase timeout from 500ms to 3000ms on macOS to account for file system caching delays when reading redirected output from temp files.
1 parent 415d01c commit b365cab

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/by-util/test_tail.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,10 +597,18 @@ fn test_follow_name_multiple() {
597597
.arg(FOOBAR_2_TXT)
598598
.run_no_wait();
599599

600+
// On macOS, file system caching can cause a delay of 2-3 seconds before
601+
// output written to a redirected stdout temp file becomes visible to other
602+
// file handles reading that same file. Increase timeout to 3000ms on macOS.
603+
#[cfg(target_os = "macos")]
604+
let initial_delay = 3000;
605+
#[cfg(not(target_os = "macos"))]
606+
let initial_delay = 500;
607+
600608
child
601-
.make_assertion_with_delay(500)
609+
.make_assertion_with_delay(initial_delay)
602610
.is_alive()
603-
.with_current_output()
611+
.with_all_output()
604612
.stdout_only_fixture("foobar_follow_multiple.expected");
605613

606614
let first_append = "trois\n";

0 commit comments

Comments
 (0)