make waiting for the server to start robust

This commit is contained in:
Benjamin Peterson 2010-02-06 22:08:15 +00:00
parent 26a1f72637
commit 239f138aea
2 changed files with 19 additions and 11 deletions

View file

@ -1574,7 +1574,7 @@ class ConfigDictTest(BaseTest):
port = find_unused_port()
t = logging.config.listen(port)
t.start()
time.sleep(0.5) # give server thread some time to get ready
t.ready.wait()
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(2.0)