On 02/12/2016 06:25 AM, Nelson H. F. Beebe wrote:
The effectively-zero load, and no CPU consumption, suggests that the
"make check" run is in a wait state.

Thanks for checking. I installed the attached patch to try to fix the test script so that it doesn't hang forever in this situation. The old test had a race condition anyway.

I don't know if the failure reflects a bug in coreutils, or in bash, or in GNU/Hurd elsewhere. If the revised test passes I guess we don't need to worry about it.
From d839e365717eb95d7358c2f06cfbc34e797592d2 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Fri, 12 Feb 2016 10:59:20 -0800
Subject: [PATCH] tests: don't wait forever on GNU/Hurd

* tests/cp/parent-perm-race.sh: Add timeouts so that the test does
not wait forever on GNU/Hurd.  This does not fix the underlying
bug but at least lets the tests make progress.
Problem reported by Nelson H.F. Beebe in: http://bugs.gnu.org/22624
Also, check that 'cp' actually copies the data; this is a better
test anyway, and simplifies the test code.
Also, avoid unlikely race if 'pid' is set in the environment.
---
 tests/cp/parent-perm-race.sh | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/tests/cp/parent-perm-race.sh b/tests/cp/parent-perm-race.sh
index 7a73740..0d0841c 100755
--- a/tests/cp/parent-perm-race.sh
+++ b/tests/cp/parent-perm-race.sh
@@ -26,7 +26,8 @@ umask 002
 mkdir mode ownership d || framework_failure_
 chmod g+s d 2>/dev/null # The cp test is valid either way.
 
-# Terminate any background cp process
+# Terminate any background cp process.
+pid=
 cleanup_() { kill $pid 2>/dev/null && wait $pid; }
 
 for attr in mode ownership
@@ -35,21 +36,14 @@ do
 
   # Copy a fifo's contents.  That way, we can examine d/$attr's
   # state while cp is running.
-  cp --preserve=$attr -R --copy-contents --parents $attr d & pid=$!
+  timeout 10 cp --preserve=$attr -R --copy-contents --parents $attr d & pid=$!
 
-  (
-    # Now 'cp' is reading the fifo.
-    # Check the permissions of the temporary destination
-    # directory that 'cp' has made.
-    ls -ld d/$attr >d/$attr.ls
+  # Check the permissions of the destination directory that 'cp' has made.
+  # 'ls' won't start until after 'cp' has made the destination directory
+  # $d/attr and has started to read the source file $attr/fifo.
+  timeout 10 sh -c "ls -ld d/$attr >$attr/fifo" || fail=1
 
-    # Close the fifo so that "cp" can continue.  But output first,
-    # before exiting, otherwise some shells would optimize away the file
-    # descriptor that holds the fifo open.
-    echo foo
-  ) >$attr/fifo
-
-  ls_output=$(cat d/$attr.ls) || fail=1
+  ls_output=$(cat d/$attr/fifo) || fail=1
   case $attr,$ls_output in
   ownership,d???--[-S]--[-S]* | \
   mode,d????-??-?* | \
-- 
2.5.0

Reply via email to