tests: fix shutdown race in test-hgweb-raw stable
authorMatt Mackall <mpm@selenic.com>
Wed, 28 Mar 2012 11:28:37 -0500
branchstable
changeset 16298 0eefd118f27e
parent 16297 1791d7662d32
child 16299 853ffcafecfa
tests: fix shutdown race in test-hgweb-raw
tests/test-hgweb-raw.t
--- a/tests/test-hgweb-raw.t	Wed Mar 28 10:29:39 2012 -0500
+++ b/tests/test-hgweb-raw.t	Wed Mar 28 11:28:37 2012 -0500
@@ -18,10 +18,10 @@
   $ hg serve -p $HGPORT -A access.log -E error.log -d --pid-file=hg.pid
 
   $ cat hg.pid >> $DAEMON_PIDS
-  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw' content-type content-length content-disposition) >getoutput.txt &
-  $ sleep 5
-  $ kill `cat hg.pid`
-  $ sleep 1 # wait for server to scream and die
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw' content-type content-length content-disposition) >getoutput.txt
+
+  $ while kill `cat hg.pid` 2>/dev/null; do true; done
+
   $ cat getoutput.txt
   200 Script output follows
   content-type: application/binary
@@ -40,10 +40,9 @@
   > --config web.guessmime=True
 
   $ cat hg.pid >> $DAEMON_PIDS
-  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw' content-type content-length content-disposition) >getoutput.txt &
-  $ sleep 5
-  $ kill `cat hg.pid`
-  $ sleep 1 # wait for server to scream and die
+  $ ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/?f=a23bf1310f6e;file=sub/some%20%22text%22.txt;style=raw' content-type content-length content-disposition) >getoutput.txt
+  $ while kill `cat hg.pid` 2>/dev/null; do true; done
+
   $ cat getoutput.txt
   200 Script output follows
   content-type: text/plain; charset="ascii"