Skip to content

Commit

Permalink
test that nested experimental KubeClusters can be run on the same eve…
Browse files Browse the repository at this point in the history
…nt loop
  • Loading branch information
graingert committed May 17, 2022
1 parent bf1b6a4 commit 534c82e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dask_kubernetes/experimental/tests/test_kubecluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ def test_multiple_clusters_simultaneously(kopf_runner, docker_image):
assert client2.submit(lambda x: x + 1, 10).result() == 11


def test_multiple_clusters_simultaneously_same_loop(kopf_runner, docker_image):
with kopf_runner:
with KubeCluster(name="fizz", image=docker_image) as cluster1, KubeCluster(
name="buzz", image=docker_image, loop=cluster1.loop
) as cluster2:
with Client(cluster1) as client1, Client(cluster2) as client2:
assert cluster1.loop is cluster2.loop is client1.loop is client2.loop
assert client1.submit(lambda x: x + 1, 10).result() == 11
assert client2.submit(lambda x: x + 1, 10).result() == 11


def test_cluster_from_name(kopf_runner, docker_image):
with kopf_runner:
with KubeCluster(name="abc", image=docker_image) as firstcluster:
Expand Down

0 comments on commit 534c82e

Please sign in to comment.