From c40e8a229710b4039569e9225b7b0ab248f2829c Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Fri, 17 Nov 2017 18:40:31 -0500 Subject: [PATCH] Make a GC test more reliable. --- tests/test_tcp.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_tcp.py b/tests/test_tcp.py index c767708..4462575 100644 --- a/tests/test_tcp.py +++ b/tests/test_tcp.py @@ -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,