Skip to content

Commit fe65f85

Browse files
check cluster prior to setting up as well
1 parent c4ef277 commit fe65f85

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/unit/test_interface.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def test_set_up_dask_client_existing_cluster() -> None:
144144
memory_limit = 1 # gb
145145
n_workers = 3
146146
threads_per_worker = 2
147+
147148
# Manually create a cluster
148149
cluster = LocalCluster( # type: ignore[no-untyped-call]
149150
name=cluster_name,
@@ -152,11 +153,17 @@ def test_set_up_dask_client_existing_cluster() -> None:
152153
memory_limit=memory_limit * 1024**3,
153154
)
154155
cluster.get_client() # type: ignore[no-untyped-call]
156+
_check_cluster(cluster_name=cluster_name, memory_limit=memory_limit * n_workers, n_workers=n_workers, threads_per_worker=threads_per_worker)
157+
155158
# Call the dask client setup function
156159
set_up_dask_client()
160+
157161
# Make sure that the cluster hasn't been changed
158162
_check_cluster(cluster_name=cluster_name, memory_limit=memory_limit * n_workers, n_workers=n_workers, threads_per_worker=threads_per_worker)
159163

164+
####################
165+
# Helper Functions #
166+
####################
160167

161168
def _check_cluster(cluster_name: str, memory_limit: int | float, n_workers: int, threads_per_worker: int) -> None:
162169
client = get_client()

0 commit comments

Comments
 (0)