##// END OF EJS Templates
tests: fix startup/shutdown races in test-https...
Matt Mackall -
r16300:74e114ac stable
parent child Browse files
Show More
@@ -233,15 +233,13 b' Fingerprints'
233 $ hg -R copy-pull id https://127.0.0.1:$HGPORT/
233 $ hg -R copy-pull id https://127.0.0.1:$HGPORT/
234 5fed3813f7f5
234 5fed3813f7f5
235
235
236 $ while kill `cat hg1.pid` 2>/dev/null; do true; done
237
236 Prepare for connecting through proxy
238 Prepare for connecting through proxy
237
239
238 $ kill `cat hg1.pid`
240 $ "$TESTDIR/tinyproxy.py" $HGPORT1 localhost >proxy.log </dev/null 2>&1 &
239 $ sleep 1
241 $ while [ ! -f proxy.pid ]; do true; done
240
241 $ ("$TESTDIR/tinyproxy.py" $HGPORT1 localhost >proxy.log 2>&1 </dev/null &
242 $ echo $! > proxy.pid)
243 $ cat proxy.pid >> $DAEMON_PIDS
242 $ cat proxy.pid >> $DAEMON_PIDS
244 $ sleep 2
245
243
246 $ echo "[http_proxy]" >> copy-pull/.hg/hgrc
244 $ echo "[http_proxy]" >> copy-pull/.hg/hgrc
247 $ echo "always=True" >> copy-pull/.hg/hgrc
245 $ echo "always=True" >> copy-pull/.hg/hgrc
@@ -12,7 +12,7 b' Any help will be greatly appreciated. '
12
12
13 __version__ = "0.2.1"
13 __version__ = "0.2.1"
14
14
15 import BaseHTTPServer, select, socket, SocketServer, urlparse
15 import BaseHTTPServer, select, socket, SocketServer, urlparse, os
16
16
17 class ProxyHandler (BaseHTTPServer.BaseHTTPRequestHandler):
17 class ProxyHandler (BaseHTTPServer.BaseHTTPRequestHandler):
18 __base = BaseHTTPServer.BaseHTTPRequestHandler
18 __base = BaseHTTPServer.BaseHTTPRequestHandler
@@ -122,7 +122,12 b' class ProxyHandler (BaseHTTPServer.BaseH'
122 do_DELETE = do_GET
122 do_DELETE = do_GET
123
123
124 class ThreadingHTTPServer (SocketServer.ThreadingMixIn,
124 class ThreadingHTTPServer (SocketServer.ThreadingMixIn,
125 BaseHTTPServer.HTTPServer): pass
125 BaseHTTPServer.HTTPServer):
126 def __init__(self, *args, **kwargs):
127 BaseHTTPServer.HTTPServer.__init__(self, *args, **kwargs)
128 a = open("proxy.pid", "w")
129 a.write(str(os.getpid()) + "\n")
130 a.close()
126
131
127 if __name__ == '__main__':
132 if __name__ == '__main__':
128 from sys import argv
133 from sys import argv
General Comments 0
You need to be logged in to leave comments. Login now