]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: fix rare false failure in tail-2/F-vs-rename
authorPádraig Brady <P@draigBrady.com>
Fri, 17 Sep 2021 00:22:54 +0000 (01:22 +0100)
committerPádraig Brady <P@draigBrady.com>
Fri, 17 Sep 2021 00:28:14 +0000 (01:28 +0100)
This is wrong fix really, as only introducing delay I think.

* tests/tail-2/F-vs-rename.sh: Avoid a rare false failure
due to a race in the test.  Now wait until tail has noticed
that b is replaced before writing to a, so that the subsequent
write of "y" to b will be displayed independently from
current contents of b ("x").

tests/tail-2/F-vs-rename.sh

index 2305c13fe6408e7653b7f121f38db3c70ebc90a9..9313fd0b60f5bb30ee4b8e0204593a128d27f16c 100755 (executable)
@@ -51,6 +51,11 @@ for mode in '' '---disable-inotify'; do
   tail_re='inaccessible' retry_delay_ check_tail_output .1 7 ||
     { cat out; fail=1; }
 
+  # Wait 12.7s for this diagnostic:
+  # tail: 'b' has been replaced;  following new file
+  tail_re='replaced' retry_delay_ check_tail_output .1 7 ||
+    { cat out; fail=1; }
+
   echo x > a
   # Wait up to 12.7s for this to appear in the output:
   # "tail: '...' has appeared;  following new file"