changeset 16296:4343d5226149 stable

tests: eliminate daemon race in test-bad-pull
author Matt Mackall <mpm@selenic.com>
date Wed, 28 Mar 2012 10:11:12 -0500
parents 795d591b6ef5
children 1791d7662d32
files tests/test-bad-pull.t
diffstat 1 files changed, 5 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- 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 $!