Skip to content

Commit

Permalink
Test for non-replicated environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Dedden committed Feb 29, 2024
1 parent 28f9c66 commit c458dca
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions dask_kubernetes/operator/controller/tests/test_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import json
import os.path
import pathlib
from collections import Counter
from contextlib import asynccontextmanager
from datetime import datetime, timedelta

Expand Down Expand Up @@ -636,6 +637,14 @@ async def test_object_dask_cluster(k8s_cluster, kopf_runner, gen_cluster):
wg = worker_groups[0]
assert isinstance(wg, DaskWorkerGroup)

# Test for non-replicated environment variables; Fix for https://github.com/dask/dask-kubernetes/issues/841
for deployment in await wg.deployments():
env_vars = deployment.spec["template"]["spec"]["containers"]["env"]
env_var_names = [env_var["name"] for env_var in env_vars]
assert len(env_var_names) == len(set(env_var_names))
assert "DASK_WORKER_NAME" in env_var_names
assert "DASK_SCHEDULER_ADDRESS" in env_var_names

scheduler_pod = await cluster.scheduler_pod()
assert isinstance(scheduler_pod, Pod)

Expand Down

0 comments on commit c458dca

Please sign in to comment.