summaryrefslogtreecommitdiff
path: root/tests/tail-2/assert-2.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tail-2/assert-2.sh')
-rwxr-xr-xtests/tail-2/assert-2.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/tail-2/assert-2.sh b/tests/tail-2/assert-2.sh
index aaf8785ae..67804feaf 100755
--- a/tests/tail-2/assert-2.sh
+++ b/tests/tail-2/assert-2.sh
@@ -28,10 +28,12 @@ check_tail_output()
{ sleep $delay; return 1; }
}
+# Terminate any background tail process
+cleanup_() { kill $pid 2>/dev/null && wait $pid; }
+
# Speedup the non inotify case
fastpoll='-s.1 --max-unchanged-stats=1'
-
for mode in '' '---disable-inotify'; do
rm -f a foo out
touch a || framework_failure_
@@ -41,16 +43,15 @@ for mode in '' '---disable-inotify'; do
# Wait up to 12.7s for tail to start.
echo x > a || framework_failure_
tail_re='^x$' retry_delay_ check_tail_output .1 7 ||
- { cat out; fail=1; }
+ { cat out; fail=1; break; }
# Wait up to 12.7s for tail to notice new foo file
ok='ok ok ok'
echo "$ok" > foo || framework_failure_
tail_re="^$ok$" retry_delay_ check_tail_output .1 7 ||
- { echo "$0: foo: unexpected delay?"; cat out; fail=1; }
+ { echo "$0: foo: unexpected delay?"; cat out; fail=1; break; }
- kill $pid
- wait $pid
+ cleanup_
done
Exit $fail