summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGilles Espinasse <g.esp@free.fr>2011-02-18 13:52:21 +0100
committerJim Meyering <meyering@redhat.com>2011-02-18 13:52:21 +0100
commite6067bcb040f110238bd7cbf9f3781f2e149e0c0 (patch)
tree00bd2c47e2ad89f86982bf3fab3ef98cdf8dd26f /tests
parent43066fe2cae42c16faa4f33596c8c7cf603b5b42 (diff)
downloadcoreutils-e6067bcb040f110238bd7cbf9f3781f2e149e0c0.tar.xz
tests: correct racy sparse-to-pipe test
* tests/cp/sparse-to-pipe: Wait for backgrounded "cat" to complete before comparing the results.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/cp/sparse-to-pipe4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/cp/sparse-to-pipe b/tests/cp/sparse-to-pipe
index 4d39458e7..9bbaafa0e 100755
--- a/tests/cp/sparse-to-pipe
+++ b/tests/cp/sparse-to-pipe
@@ -26,6 +26,10 @@ timeout 10 cat pipe > copy &
truncate -s1M sparse || framework_failure_
cp sparse pipe || fail=1
+
+# Ensure that the cat has completed before comparing.
+wait
+
cmp sparse copy || fail=1
Exit $fail