changeset 16298:0eefd118f27e stable

tests: fix shutdown race in test-hgweb-raw
author Matt Mackall <mpm@selenic.com>
date Wed, 28 Mar 2012 11:28:37 -0500
parents 1791d7662d32
children 853ffcafecfa
files tests/test-hgweb-raw.t
diffstat 1 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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"