changeset 16301:de4cb5c42007 stable

tests: fix startup race in test-http-proxy
author Matt Mackall <mpm@selenic.com>
date Wed, 28 Mar 2012 19:24:11 -0500
parents 74e114ac6ec1
children 49b54f1ae053
files tests/test-http-proxy.t
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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