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

Use config_for_cluster_tests in sync cluster #8180

Merged
merged 1 commit into from
Sep 12, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions distributed/tests/test_utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1091,3 +1091,19 @@ async def test_ensure_no_new_clients():
async with Client(s.address, asynchronous=True):
with ensure_no_new_clients():
pass


@pytest.mark.parametrize("nanny", [False, True])
def test_cluster_uses_config_for_test(nanny):
key = "distributed.admin.tick.interval"
local = dask.config.get(key)

with cluster(nanny=nanny, nworkers=1) as (scheduler, workers):
with Client(scheduler["address"]) as client:
s_remote = client.run_on_scheduler(dask.config.get, key)
assert s_remote != local

w_remote = client.run(dask.config.get, key)
w_remote = next(iter(w_remote.values()))
assert w_remote != local
assert w_remote == s_remote
6 changes: 3 additions & 3 deletions distributed/utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@


def run_worker(q, scheduler_q, config, **kwargs):
with dask.config.set(config):
with config_for_cluster_tests(**config):

Check warning on line 401 in distributed/utils_test.py

View check run for this annotation

Codecov / codecov/patch

distributed/utils_test.py#L401

Added line #L401 was not covered by tests
from distributed import Worker

reset_logger_locks()
Expand All @@ -422,7 +422,7 @@

@log_errors
def run_nanny(q, scheduler_q, config, **kwargs):
with dask.config.set(config):
with config_for_cluster_tests(**config):

Check warning on line 425 in distributed/utils_test.py

View check run for this annotation

Codecov / codecov/patch

distributed/utils_test.py#L425

Added line #L425 was not covered by tests
scheduler_addr = scheduler_q.get()

async def _():
Expand Down Expand Up @@ -617,7 +617,7 @@

enable_proctitle_on_children()

with check_process_leak(check=True), check_instances(), config_for_cluster_tests():
with check_process_leak(check=True), check_instances():
if nanny:
_run_worker = run_nanny
else:
Expand Down