[PATCH] tests: keep shooting until hgweb is dead

Mads Kiilerich mads at kiilerich.com
Tue Nov 25 18:53:01 CST 2008


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1227660767 -3600
# Node ID a2587b871e67707ca146c22218b9b6df2d15b801
# Parent  d3f1d316b72b383399d248756acf3f46ce00c8d6
tests: keep shooting until hgweb is dead

hgweb tests often failed on my system because the serve port wasn't free when a
new hgweb was started; the killed hg wasn't completely dead yet. Now we keep
killing until there is nothing left to kill.

diff --git a/tests/test-hgweb b/tests/test-hgweb
--- a/tests/test-hgweb
+++ b/tests/test-hgweb
@@ -31,7 +31,7 @@
 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/bork?style=raw'
 
 echo % stop and restart
-kill `cat hg.pid`
+while kill `cat hg.pid` 2> /dev/null; do :; done
 hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log
 cat hg.pid >> $DAEMON_PIDS
 # Test the access/error files are opened in append mode
diff --git a/tests/test-hgweb-diffs b/tests/test-hgweb-diffs
--- a/tests/test-hgweb-diffs
+++ b/tests/test-hgweb-diffs
@@ -20,7 +20,7 @@
 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/a'
 
 echo % set up hgweb with git diffs
-kill `cat hg.pid`
+while kill `cat hg.pid` 2> /dev/null; do :; done
 hg serve --config 'diff.git=1' -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
 cat hg.pid >> $DAEMON_PIDS
 


More information about the Mercurial-devel mailing list