Skip to content

Commit

Permalink
Fix discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtomlinson committed Aug 7, 2023
1 parent 5e5a907 commit fb04966
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions dask_kubernetes/operator/kubecluster/tests/test_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@


@pytest.mark.anyio
async def test_discovery(async_cluster):
clusters = [name async for name, _ in discover()]
assert async_cluster.name in clusters
async with KubeCluster.from_name(async_cluster.name, asynchronous=True) as cluster2:
assert async_cluster == cluster2
assert "id" in cluster2.scheduler_info
async with Client(cluster2, asynchronous=True) as client:
assert await client.submit(lambda x: x + 1, 10).result() == 11
async def test_discovery(kopf_runner, docker_image):
with kopf_runner:
async with KubeCluster(
image=docker_image, n_workers=1, asynchronous=True
) as cluster:
clusters = [name async for name, _ in discover()]
assert cluster.name in clusters
async with KubeCluster.from_name(
cluster.name, asynchronous=True
) as cluster2:
assert cluster == cluster2
assert "id" in cluster2.scheduler_info
async with Client(cluster2, asynchronous=True) as client:
assert await client.submit(lambda x: x + 1, 10).result() == 11

0 comments on commit fb04966

Please sign in to comment.