bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tests: tail-2/pid: use a 3-second timeout, not 1


From: Jim Meyering
Subject: [PATCH] tests: tail-2/pid: use a 3-second timeout, not 1
Date: Wed, 30 Sep 2009 23:32:10 +0200

FYI, I ran make -j9 check on a fast quad-core system earlier
today and saw this failure:

    FAIL: tail-2/pid (exit: 1)
    ==========================
    ...
    + timeout 1 tail -s.1 -f /dev/null --pid=2147483647
    + test 124 = 124
    + fail=1

To me, that means it took more than 1 second for the child to start,
and so the parent's 1-second timeout expired, causing the failure.

Here's the proposed patch:


>From 30a227673eb4b095563c0ff75c6d89a7cae5096a Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 30 Sep 2009 23:28:13 +0200
Subject: [PATCH] tests: tail-2/pid: use a 3-second timeout, not 1

* tests/tail-2/pid: When using the timeout program to ensuring that
tail -s.1 --pid=$PID_T_MAX does not wait forever, use a timeout longer
than 1 second.  A 1-second timeout could be too short on a very busy
system, and result in a timeout, and hence false-positive failure.

2009-09-30  Jim Meyering  <address@hidden>
---
 tests/tail-2/pid |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/tail-2/pid b/tests/tail-2/pid
index aaf2e01..90f1684 100755
--- a/tests/tail-2/pid
+++ b/tests/tail-2/pid
@@ -42,13 +42,13 @@ for inotify in ---disable-inotify ''; do

   # Ensure that tail --pid=PID exits successfully when PID is dead.
   # Use an unlikely-to-be-live PID
-  timeout 1 tail -s.1 --pid=$PID_T_MAX -f $inotify /dev/null
+  timeout 3 tail -s.1 --pid=$PID_T_MAX -f $inotify /dev/null
   ret=$?
   test $ret = 124 && skip_test_ "pid $PID_T_MAX present"
   test $ret = 0 || fail=1

   # Ensure fractional sleep parameter is honored with --pid
-  timeout 1 tail -s.1 -f $inotify /dev/null --pid=$PID_T_MAX
+  timeout 3 tail -s.1 -f $inotify /dev/null --pid=$PID_T_MAX
   test $? = 124 && fail=1
 done

--
1.6.5.rc2.177.ga9dd6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]