From e6067bcb040f110238bd7cbf9f3781f2e149e0c0 Mon Sep 17 00:00:00 2001 From: Gilles Espinasse Date: Fri, 18 Feb 2011 13:52:21 +0100 Subject: tests: correct racy sparse-to-pipe test * tests/cp/sparse-to-pipe: Wait for backgrounded "cat" to complete before comparing the results. --- tests/cp/sparse-to-pipe | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') 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 -- cgit v1.2.3-70-g09d2