summaryrefslogtreecommitdiff
path: root/tests/tail-2/flush-initial
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tail-2/flush-initial')
-rwxr-xr-xtests/tail-2/flush-initial17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/tail-2/flush-initial b/tests/tail-2/flush-initial
index cf5438011..98de2e1f5 100755
--- a/tests/tail-2/flush-initial
+++ b/tests/tail-2/flush-initial
@@ -29,14 +29,15 @@ echo line > in || fail=1
tail -f in > out &
tail_pid=$!
-# Wait for 1 second for the file to be flushed.
-for i in $(seq 10); do
- test -s out && break
- echo sleep .1s
- sleep .1
-done
-
-test -s out || fail=1
+# Wait for 1.5s for the file to be flushed.
+tail_flush()
+{
+ local delay="$1"
+
+ test -s out ||
+ { sleep "$delay"; return 1; }
+}
+retry_delay_ tail_flush .1 5 || fail=1
kill $tail_pid