Commit 461261b7 authored by Jason Madden's avatar Jason Madden

Allow time to propagate (PyPy).

parent fad6b21f
...@@ -142,8 +142,14 @@ class Test(greentest.TestCase): ...@@ -142,8 +142,14 @@ class Test(greentest.TestCase):
client = Client(server.server_port) client = Client(server.server_port)
start_new_thread(client.make_request) start_new_thread(client.make_request)
# Wait until we do our business # Wait until we do our business; we will always close
while server.socket is not None: # the server; We may also close the client.
# On PyPy, we may not actually see the changes they write to
# their dicts immediately.
for obj in server, client:
if obj is None:
continue
while obj.socket is not None:
sleep(0.01) sleep(0.01)
# If we have a client, then we should have data # If we have a client, then we should have data
...@@ -153,7 +159,6 @@ class Test(greentest.TestCase): ...@@ -153,7 +159,6 @@ class Test(greentest.TestCase):
return wref_to_hidden_server_socket return wref_to_hidden_server_socket
def run_and_check(self, run_client): def run_and_check(self, run_client):
wref_to_hidden_server_socket = self.run_interaction(run_client=run_client) wref_to_hidden_server_socket = self.run_interaction(run_client=run_client)
greentest.gc_collect_if_needed() greentest.gc_collect_if_needed()
...@@ -170,7 +175,6 @@ class Test(greentest.TestCase): ...@@ -170,7 +175,6 @@ class Test(greentest.TestCase):
self.run_and_check(True) self.run_and_check(True)
self.run_and_check(True) self.run_and_check(True)
def test_timeout_exit(self): def test_timeout_exit(self):
self.run_and_check(False) self.run_and_check(False)
self.run_and_check(False) self.run_and_check(False)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment