diff options
Diffstat (limited to 'tests/test-bad-pull.t')
-rw-r--r-- | tests/test-bad-pull.t | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/tests/test-bad-pull.t b/tests/test-bad-pull.t index 7e32388..1b7b163 100644 --- a/tests/test-bad-pull.t +++ b/tests/test-bad-pull.t @@ -1,17 +1,9 @@ - $ "$TESTDIR/hghave" serve || exit 80 - -#if windows - $ hg clone http://localhost:$HGPORT/ copy - abort: * (glob) - [255] -#else $ hg clone http://localhost:$HGPORT/ copy abort: error: Connection refused [255] -#endif - $ test -d copy - [1] + $ test -d copy || echo copy: No such file or directory + copy: No such file or directory $ cat > dumb.py <<EOF > import BaseHTTPServer, SimpleHTTPServer, os, signal @@ -19,15 +11,20 @@ > handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler): > server_address = ('localhost', int(os.environ['HGPORT'])) > httpd = server_class(server_address, handler_class) - > open("listening", "w") - > httpd.handle_request() + > httpd.serve_forever() + > signal.signal(signal.SIGTERM, lambda x: sys.exit(0)) > run() > EOF - $ python dumb.py 2> log & - $ P=$! - $ while [ ! -f listening ]; do sleep 0; done - $ hg clone http://localhost:$HGPORT/foo copy2 + $ 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 abort: HTTP Error 404: * (glob) [255] - $ wait $P + + $ kill $! |