On 03/09/13 07:49, Bruce Korb wrote:
> On 03/09/13 06:10, Michael Tautschnig wrote:
>> Package: autogen
>> Version: 1:5.12-0.1
>> Usertags: goto-cc
>>
>> The test suite in autoopts/test/ includes a kind of watchdog for each test,
>> which supposedly terminates it after 51*kill_delay seconds. usage.test sets
>> kill_delay to 10 seconds (all others have kill_delay=3), resulting in the
>> watchdog part waiting for up to 510 seconds, which generally is far longer 
>> than
>> the remaining package build takes.
>>
>> As a result, files remain open and the package build cannot complete properly
>> when working in a chroot (and waiting to umount the build directory).

Ah.  The process should "cd" to / then, too?

>> Most likely it suffices to reduce the kill_delay for usage.test, but a proper
>> implementation would terminate the watchdog whenever the test itself has
>> ended properly.
> 
> Makes sense.  I did something quick and dirty because I've had stuff hang
> forever and this was easy to do.  I'm open to suggestions....

Maybe this?  "AG_TIMEOUT" is an adjustment for the platform speed.
"51" is a pretty high number for that.

diff --git a/autoopts/test/defs.in b/autoopts/test/defs.in
index cf000eb..f797d64 100644
--- a/autoopts/test/defs.in
+++ b/autoopts/test/defs.in
@@ -343,14 +343,19 @@ trap "failure 'test ${testname} killed on timeout'"
15
 ( ( exec > /dev/null 2>&1 </dev/null
     test -z "${kill_delay}" && kill_delay=3
     kill_delay=`expr $kill_delay '*' $AG_TIMEOUT`
-    sleep ${kill_delay}
-    ps -p $$ || exit
+    while test ${kill_delay} -gt 0
+    do  sleep 1
+        ps -p $$ || exit 0
+        kill_delay=`expr $kill_delay - 1`
+    done
     kill -15 $$
     sleep 1
     ps -p $$ || exit
-    test -d ${builddir}/FAILURES || \
-      mkdir ${builddir}/FAILURES
-    mv -f `dirname $logfile` ${builddir}/FAILURES/.
+    test -d "$builddir" && {
+      test -d ${builddir}/FAILURES || \
+        mkdir ${builddir}/FAILURES
+      mv -f `dirname $logfile` ${builddir}/FAILURES/.
+    }
     kill -9 $$
 ) &
 )


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to