summaryrefslogtreecommitdiff
path: root/tests/tail-2
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2004-03-24 12:13:12 +0000
committerJim Meyering <jim@meyering.net>2004-03-24 12:13:12 +0000
commit2d78b8bd47ad7dfe63a9ce84fd6cf33c20de5765 (patch)
tree28e6e348be981470ae3295dd054af46da85ba5c9 /tests/tail-2
parent6a8f1849c115a0d06b22a54f5ce9d1820aca7678 (diff)
downloadcoreutils-2d78b8bd47ad7dfe63a9ce84fd6cf33c20de5765.tar.xz
Avoid race condition that could cause
spurious failure. Based on a patch from Andreas Schwab.
Diffstat (limited to 'tests/tail-2')
-rwxr-xr-xtests/tail-2/assert10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/tail-2/assert b/tests/tail-2/assert
index 49e62c40e..a837798f3 100755
--- a/tests/tail-2/assert
+++ b/tests/tail-2/assert
@@ -30,9 +30,15 @@ tail --follow=name a foo > err 2>&1 &
tail_pid=$!
# Arrange for the tail process to die after 12 seconds.
(sleep 12; kill $tail_pid) &
-rm -f foo
+
echo sleeping for 7 seconds...
-sleep 7
+
+# Give the backgrounded `tail' a chance to start before removing foo.
+# Otherwise, without --retry, tail wouldn't try to open `foo' again.
+sleep 1
+
+rm -f foo
+sleep 6
echo $ok > f
mv f foo