diff options
Diffstat (limited to 'Lib/test/test_docxmlrpc.py')
-rw-r--r-- | Lib/test/test_docxmlrpc.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_docxmlrpc.py b/Lib/test/test_docxmlrpc.py index cb6366c..eb97516 100644 --- a/Lib/test/test_docxmlrpc.py +++ b/Lib/test/test_docxmlrpc.py @@ -87,10 +87,11 @@ class DocXMLRPCHTTPGETServer(unittest.TestCase): threading.Thread(target=server, args=(self.evt, 1)).start() # wait for port to be assigned - n = 1000 - while n > 0 and PORT is None: - time.sleep(0.001) - n -= 1 + deadline = time.monotonic() + 10.0 + while PORT is None: + time.sleep(0.010) + if time.monotonic() > deadline: + break self.client = http.client.HTTPConnection("localhost:%d" % PORT) |