On GNU/Hurd, this test would get stuck in an infinite loop like the
following:

    + kill -s INFO 16535
    + sleep .01
    + kill -s INFO 16535
    + sleep .01
    + kill -s INFO 16535
    + sleep .01
    [...]

The signals being sent that frequently seem to prevent 'dd' from
performing writes, since it outputs the following during that time:

    0+0 records in
    0+0 records out
    0 bytes copied, 7161.11 s, 0.0 kB/s
    0+0 records in
    0+0 records out
    0 bytes copied, 7161.88 s, 0.0 kB/s
    [...]

* tests/dd/stats.sh: Use a larger interval between signals on GNU/Hurd.
---
 tests/dd/stats.sh | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tests/dd/stats.sh b/tests/dd/stats.sh
index db650f80d..da9bea774 100755
--- a/tests/dd/stats.sh
+++ b/tests/dd/stats.sh
@@ -37,6 +37,16 @@ cleanup_()
   wait
 }
 
+# On GNU/Hurd, sending a signal every .01 seconds would lead to an
+# infinite loop with zero bytes being written.  Doubling the interval
+# to .02 seconds works fine.  Keep the smaller on other platforms where
+# it doesn't cause issues.
+if test "$(uname)" = GNU; then
+  siginfo_interval=.02
+else
+  siginfo_interval=.01
+fi
+
 for open in '' '1'; do
   > err || framework_failure_
 
@@ -56,7 +66,7 @@ for open in '' '1'; do
   # to race setting handler, or blocking on open of fifo.
   # Many signals also check that short reads are handled.
   until ! kill -s $SIGINFO $pid 2>/dev/null; do
-    sleep .01
+    sleep $siginfo_interval
   done
 
   wait
-- 
2.55.0


Reply via email to