Skip to content

Commit 884a595

Browse files
committed
Use client.run for async function
Using `client.submit` seems not allowed to resolve `get_worker`, but `client.run` does.
1 parent 8d5241f commit 884a595

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

dask_cuda/tests/test_proxify_host_file.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from dask.utils import format_bytes
1313
from distributed import Client
1414
from distributed.utils_test import gen_test
15-
from distributed.worker import get_worker
1615

1716
import dask_cuda
1817
import dask_cuda.proxify_device_objects
@@ -429,9 +428,9 @@ async def test_worker_force_spill_to_disk():
429428
ddf = dask.dataframe.from_pandas(df, npartitions=1).persist()
430429
await ddf
431430

432-
async def f():
431+
async def f(dask_worker):
433432
"""Trigger a memory_monitor() and reset memory_limit"""
434-
w = get_worker()
433+
w = dask_worker
435434
# Set a host memory limit that triggers spilling to disk
436435
w.memory_manager.memory_pause_fraction = False
437436
memory = w.monitor.proc.memory_info().rss
@@ -443,7 +442,7 @@ async def f():
443442
assert w.monitor.proc.memory_info().rss < memory - 10**7
444443
w.memory_manager.memory_limit = memory * 10 # Un-limit
445444

446-
await client.submit(f)
445+
client.run(f)
447446
log = str(await client.get_worker_logs())
448447
# Check that the worker doesn't complain about unmanaged memory
449448
assert "Unmanaged memory use is high" not in log

0 commit comments

Comments
 (0)