Skip to content

Commit

Permalink
Add regression test for #6320
Browse files Browse the repository at this point in the history
  • Loading branch information
fjetter committed May 19, 2022
1 parent 6d831da commit 1259504
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions distributed/cli/tests/test_dask_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,3 +682,23 @@ def dask_setup(worker):
await c.wait_for_workers(1)
[foo] = (await c.run(lambda dask_worker: dask_worker.foo)).values()
assert foo == "setup"


@pytest.mark.parametrize("nanny", ["--nanny", "--no-nanny"])
def test_error_during_startup(monkeypatch, nanny):
# see https://github.com/dask/distributed/issues/6320
scheduler_port = 8786
scheduler_addr = f"tcp://127.0.0.1:{scheduler_port}"

monkeypatch.setenv("DASK_SCHEDULER_ADDRESS", scheduler_addr)
with popen(["dask-scheduler"]):
with popen(
[
"dask-worker",
scheduler_addr,
nanny,
"--worker-port",
str(scheduler_port),
],
) as worker:
assert worker.wait(5) == 1

0 comments on commit 1259504

Please sign in to comment.