tests: correct racy sparse-to-pipe test
authorGilles Espinasse <g.esp@free.fr>
Fri, 18 Feb 2011 12:52:21 +0000 (13:52 +0100)
committerJim Meyering <meyering@redhat.com>
Fri, 18 Feb 2011 12:52:21 +0000 (13:52 +0100)
* tests/cp/sparse-to-pipe: Wait for backgrounded "cat" to complete
before comparing the results.

tests/cp/sparse-to-pipe

index 4d39458..9bbaafa 100755 (executable)
@@ -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