Skip to content

Commit

Permalink
Ensure listener closes in test_close_callback
Browse files Browse the repository at this point in the history
  • Loading branch information
pentschev committed Oct 11, 2023
1 parent 3bf5589 commit 4a4c315
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_endpoint.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import asyncio

import pytest

import ucp
Expand All @@ -16,6 +18,7 @@ async def server_node(ep):
ep.set_close_callback(_close_callback)
if server_close_callback is False:
await ep.close()
listener.close()

async def client_node(port):
ep = await ucp.create_endpoint(
Expand All @@ -31,6 +34,8 @@ async def client_node(port):
server_node,
)
await client_node(listener.port)
while not listener.closed():
await asyncio.sleep(0.01)
assert closed[0] is True


Expand Down

0 comments on commit 4a4c315

Please sign in to comment.