view tests/test-bad-pull @ 545:721bfca3a9dc

Work-around failing tests/test-bad-pull with slow bg process. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Work-around failing tests/test-bad-pull with slow bg process. Without the 'sleep 2' python dumb.py often appeared after hg clone. manifest hash: b32381ac46a7691f2a92595b650b2406853644c2 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFCxOM+W7P1GVgWeRoRAjgTAJ9OqrikdK043Eiyyx9dG8DR1XZ7tgCggdmM AVYvAZO3P+WlaWDu3MaxEXY= =0XN5 -----END PGP SIGNATURE-----
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 01 Jul 2005 07:31:26 +0100
parents 3d4d5f2aba9a
children 4fc63e22b1fe
line wrap: on
line source

#!/bin/sh -x

hg clone http://localhost:20059/ copy
echo $?
ls copy

cat > dumb.py <<EOF
import BaseHTTPServer, SimpleHTTPServer, signal

def run(server_class=BaseHTTPServer.HTTPServer,
        handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler):
    server_address = ('localhost', 20059)
    httpd = server_class(server_address, handler_class)
    httpd.serve_forever()

signal.signal(signal.SIGTERM, lambda x: sys.exit(0))
run()
EOF

python dumb.py 2>/dev/null &
sleep 2

hg clone http://localhost:20059/foo copy2
echo $?

set +x
kill $!