Skip to content

Commit

Permalink
remove unused disconnect functions
Browse files Browse the repository at this point in the history
  • Loading branch information
gjoseph92 committed Aug 4, 2022
1 parent 07803f0 commit 993f420
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions distributed/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,26 +689,6 @@ async def wait_for_workers():
client.close()


async def disconnect(addr, timeout=3, rpc_kwargs=None):
rpc_kwargs = rpc_kwargs or {}

async def do_disconnect():
async with rpc(addr, **rpc_kwargs) as w:
# If the worker was killed hard (e.g. sigterm) during test runtime,
# we do not know at this point and may not be able to connect
with suppress(EnvironmentError, CommClosedError):
# Do not request a reply since comms will be closed by the
# worker before a reply can be made and we will always trigger
# the timeout
await w.terminate(reply=False)

await asyncio.wait_for(do_disconnect(), timeout=timeout)


async def disconnect_all(addresses, timeout=3, rpc_kwargs=None):
await asyncio.gather(*(disconnect(addr, timeout, rpc_kwargs) for addr in addresses))


def gen_test(
timeout: float = _TEST_TIMEOUT,
clean_kwargs: dict[str, Any] | None = None,
Expand Down

0 comments on commit 993f420

Please sign in to comment.