Properly handle test case where server doesn't start

This commit is contained in:
Jim Paris 2013-01-24 16:03:23 -05:00
parent e7af863017
commit b226dc4337

View File

@ -113,7 +113,8 @@ class TestBlockingServer(object):
self.server.start(blocking = True, event = event)
thread = threading.Thread(target = run_server)
thread.start()
event.wait(timeout = 2)
if not event.wait(timeout = 10):
raise AssertionError("server didn't start in 10 seconds")
# Send request to exit.
req = urlopen("http://127.0.0.1:12380/exit/", timeout = 1)