tests: eliminate daemon race in test-bad-pull stable
authorMatt Mackall <mpm@selenic.com>
Wed, 28 Mar 2012 10:11:12 -0500
branchstable
changeset 16296 4343d5226149
parent 16294 795d591b6ef5
child 16297 1791d7662d32
tests: eliminate daemon race in test-bad-pull
tests/test-bad-pull.t
--- a/tests/test-bad-pull.t	Tue Mar 27 16:13:59 2012 -0500
+++ b/tests/test-bad-pull.t	Wed Mar 28 10:11:12 2012 -0500
@@ -13,20 +13,12 @@
   >         handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler):
   >     server_address = ('localhost', int(os.environ['HGPORT']))
   >     httpd = server_class(server_address, handler_class)
-  >     httpd.serve_forever()
-  > signal.signal(signal.SIGTERM, lambda x: sys.exit(0))
+  >     os.system("hg clone http://localhost:$HGPORT/foo copy2&")
+  >     httpd.handle_request()
   > run()
   > EOF
 
-  $ python dumb.py 2>/dev/null &
-  $ echo $! >> $DAEMON_PIDS
-
-give the server some time to start running
-
-  $ sleep 1
-
-  $ hg clone http://localhost:$HGPORT/foo copy2 2>&1
+  $ python dumb.py
+  localhost - - [*] code 404, message File not found (glob)
+  localhost - - [*] "GET /foo?cmd=capabilities HTTP/1.1" 404 - (glob)
   abort: HTTP Error 404: * (glob)
-  [255]
-
-  $ kill $!