tests: fix startup race in test-http-proxy stable
authorMatt Mackall <mpm@selenic.com>
Wed, 28 Mar 2012 19:24:11 -0500
branchstable
changeset 16301 de4cb5c42007
parent 16300 74e114ac6ec1
child 16302 49b54f1ae053
tests: fix startup race in test-http-proxy
tests/test-http-proxy.t
--- a/tests/test-http-proxy.t	Wed Mar 28 19:23:25 2012 -0500
+++ b/tests/test-http-proxy.t	Wed Mar 28 19:24:11 2012 -0500
@@ -8,10 +8,9 @@
   $ hg --config server.uncompressed=True serve -p $HGPORT -d --pid-file=hg.pid
   $ cat hg.pid >> $DAEMON_PIDS
   $ cd ..
-  $ ("$TESTDIR/tinyproxy.py" $HGPORT1 localhost >proxy.log 2>&1 </dev/null &
-  $ echo $! > proxy.pid)
+  $ "$TESTDIR/tinyproxy.py" $HGPORT1 localhost >proxy.log 2>&1 </dev/null &
+  $ while [ ! -f proxy.pid ]; do true; done
   $ cat proxy.pid >> $DAEMON_PIDS
-  $ sleep 2
 
 url for proxy, stream