Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d8ed156

Browse files
author
saville
committed
Add tests to ensure that tasks are closed and transport is cleaned up properly
1 parent 5c74aaf commit d8ed156

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/pytests/functional/transport/server/test_request_server.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,16 @@ async def handler(message):
4444
try:
4545

4646
ret = await req_client.send({"req": "test"})
47+
if transport == "tcp":
48+
assert req_client.task is not None
4749
assert [reqmsg] == requests
4850
assert repmsg == ret
4951
finally:
5052
req_client.close()
53+
if transport == "tcp":
54+
# Ensure that issue 68277 is fixed
55+
assert req_client.task is None or req_client.task.done()
56+
assert req_client._closing
5157
req_server.close()
5258

5359
# Yield to loop in order to allow background close methods to finish.

0 commit comments

Comments
 (0)