diff tests/test-https.t @ 16300:74e114ac6ec1 stable

tests: fix startup/shutdown races in test-https tinyproxy now writes its own pid when it's ready to accept connections
author Matt Mackall <mpm@selenic.com>
date Wed, 28 Mar 2012 19:23:25 -0500
parents a3dcc59054ca
children abbabbbe4ec2
line wrap: on
line diff
--- a/tests/test-https.t	Wed Mar 28 12:02:38 2012 -0500
+++ b/tests/test-https.t	Wed Mar 28 19:23:25 2012 -0500
@@ -233,15 +233,13 @@
   $ hg -R copy-pull id https://127.0.0.1:$HGPORT/
   5fed3813f7f5
 
+  $ while kill `cat hg1.pid` 2>/dev/null; do true; done
+
 Prepare for connecting through proxy
 
-  $ kill `cat hg1.pid`
-  $ sleep 1
-
-  $ ("$TESTDIR/tinyproxy.py" $HGPORT1 localhost >proxy.log 2>&1 </dev/null &
-  $ echo $! > proxy.pid)
+  $ "$TESTDIR/tinyproxy.py" $HGPORT1 localhost >proxy.log </dev/null 2>&1 &
+  $ while [ ! -f proxy.pid ]; do true; done
   $ cat proxy.pid >> $DAEMON_PIDS
-  $ sleep 2
 
   $ echo "[http_proxy]" >> copy-pull/.hg/hgrc
   $ echo "always=True" >> copy-pull/.hg/hgrc