Make a GC test more reliable.

This commit is contained in:
Yury Selivanov 2017-11-17 18:40:31 -05:00
parent ec50b7c4a2
commit c40e8a2297
1 changed files with 5 additions and 0 deletions

View File

@ -714,7 +714,12 @@ class Test_UV_TCP(_TestTCP, tb.UVTestCase):
with self.assertWarnsRegex(ResourceWarning, rx):
self.loop.create_task(run())
self.loop.run_until_complete(srv.wait_closed())
srv = None
gc.collect()
gc.collect()
gc.collect()
self.loop.run_until_complete(asyncio.sleep(0.1, loop=self.loop))
# Since one TCPTransport handle wasn't closed correctly,