From c95c0a0fd4b8dc72a66484f3f361a3afb9acdc94 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Tue, 31 Jan 2017 21:27:41 -0800 Subject: tests: fix tail test race causing false failure * tests/tail-2/retry.sh: The replacement of the "missing" directory is not atomic, and therefore tail(1) can take a different path, especially if there is a delay between the rmdir(2) and creat(2). This is noticeable for example with `make coverage` because in that case the coverage files written by rmdir(1) on exit, induce a significant delay thus triggering the issue. --- tests/tail-2/retry.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/tail-2/retry.sh b/tests/tail-2/retry.sh index 40d66d60c..8e58cce78 100755 --- a/tests/tail-2/retry.sh +++ b/tests/tail-2/retry.sh @@ -172,8 +172,9 @@ retry_delay_ wait4lines_ .1 6 4 || { cat out; fail=1; } cleanup_ [ "$(countlines_)" = 4 ] || { fail=1; cat out; } grep -F 'cannot follow' out || { fail=1; cat out; } -grep -F 'has become accessible' out || { fail=1; cat out; } -grep -F 'giving up' out && { fail=1; cat out; } +# The first is the common case, "has appeared" arises with slow rmdir. +grep -E 'become accessible|has appeared' out || { fail=1; cat out; } +grep -F 'giving up' out && { fail=1; cat out; } grep -F 'foo' out || { fail=1; cat out; } rm -fd untailable out || framework_failure_ fi -- cgit v1.2.3-54-g00ecf