From e02607d5a5dbaeb1d452ed11dced97a973580f97 Mon Sep 17 00:00:00 2001 From: naoNao89 <90588855+naoNao89@users.noreply.github.com> Date: Fri, 12 Dec 2025 03:36:54 +0700 Subject: [PATCH] test(tail): fix flaky test_follow_name_multiple on macOS Increase timeout from 500ms to 1300ms on macOS to account for file system caching delays when reading redirected output from temp files. --- tests/by-util/test_tail.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/by-util/test_tail.rs b/tests/by-util/test_tail.rs index 3f6455c21b2..c99569c270f 100644 --- a/tests/by-util/test_tail.rs +++ b/tests/by-util/test_tail.rs @@ -597,10 +597,17 @@ fn test_follow_name_multiple() { .arg(FOOBAR_2_TXT) .run_no_wait(); + // On macOS, file system caching can cause delays before output written + // to a redirected stdout temp file becomes visible to other file handles. + #[cfg(target_os = "macos")] + let initial_delay = 1300; + #[cfg(not(target_os = "macos"))] + let initial_delay = 500; + child - .make_assertion_with_delay(500) + .make_assertion_with_delay(initial_delay) .is_alive() - .with_current_output() + .with_all_output() .stdout_only_fixture("foobar_follow_multiple.expected"); let first_append = "trois\n";