Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail if scheduler starts with '-' in dask-cuda-worker #485

Merged
merged 2 commits into from
Jan 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions dask_cuda/cli/dask_cuda_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,13 @@ def main(
else:
security = None

if isinstance(scheduler, str) and scheduler.startswith("-"):
raise ValueError(
"The scheduler address can't start with '-'. Please check "
"your command line arguments, you probably attempted to use "
"unsupported one. Scheduler address: %s" % scheduler
)

worker = CUDAWorker(
scheduler,
host,
Expand Down
7 changes: 7 additions & 0 deletions dask_cuda/tests/test_dask_cuda_worker.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import absolute_import, division, print_function

import os
import subprocess

import pytest

Expand Down Expand Up @@ -98,3 +99,9 @@ def test_rmm_managed(loop): # noqa: F811
)
for v in memory_resource_type.values():
assert v is rmm.mr.ManagedMemoryResource


def test_unknown_argument():
ret = subprocess.run(["dask-cuda-worker", "--my-argument"], capture_output=True)
assert ret.returncode != 0
assert b"Scheduler address: --my-argument" in ret.stderr