From e0ff5c401bf4b0be866ae41baeecc17baf22b511 Mon Sep 17 00:00:00 2001 From: Matt Ellis Date: Thu, 3 Feb 2022 17:30:51 -0600 Subject: [PATCH] Fix is_active() call to check_cluster_status(). --- smartsim/database/orchestrator.py | 2 +- tests/on_wlm/test_launch_orc_cobalt.py | 4 ++++ tests/on_wlm/test_launch_orc_pbs.py | 4 ++++ tests/on_wlm/test_launch_orc_slurm.py | 4 ++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/smartsim/database/orchestrator.py b/smartsim/database/orchestrator.py index 176fb3681..3748ec28b 100644 --- a/smartsim/database/orchestrator.py +++ b/smartsim/database/orchestrator.py @@ -168,7 +168,7 @@ def is_active(self): # if a cluster else: try: - check_cluster_status(trials=1) + check_cluster_status(self._hosts, self.ports, trials=1) return True # we expect this to fail if the cluster is not active except SSInternalError: diff --git a/tests/on_wlm/test_launch_orc_cobalt.py b/tests/on_wlm/test_launch_orc_cobalt.py index 55c5c2876..ad99e7c45 100644 --- a/tests/on_wlm/test_launch_orc_cobalt.py +++ b/tests/on_wlm/test_launch_orc_cobalt.py @@ -65,6 +65,10 @@ def test_launch_cobalt_cluster_orc(fileutils, wlmutils): exp.stop(orc) assert False + if len(orc.get_address()) < 3: + exp.stop(orc) + assert False + exp.stop(orc) status = exp.get_status(orc) assert all([stat == status.STATUS_CANCELLED for stat in status]) diff --git a/tests/on_wlm/test_launch_orc_pbs.py b/tests/on_wlm/test_launch_orc_pbs.py index 5ce0fef61..94d53e5f5 100644 --- a/tests/on_wlm/test_launch_orc_pbs.py +++ b/tests/on_wlm/test_launch_orc_pbs.py @@ -68,6 +68,10 @@ def test_launch_pbs_cluster_orc(fileutils, wlmutils): exp.stop(orc) assert False + if len(orc.get_address()) < 3: + exp.stop(orc) + assert False + exp.stop(orc) status = exp.get_status(orc) assert all([stat == status.STATUS_CANCELLED for stat in status]) diff --git a/tests/on_wlm/test_launch_orc_slurm.py b/tests/on_wlm/test_launch_orc_slurm.py index 34f90a537..bc3e86769 100644 --- a/tests/on_wlm/test_launch_orc_slurm.py +++ b/tests/on_wlm/test_launch_orc_slurm.py @@ -61,6 +61,10 @@ def test_launch_slurm_cluster_orc(fileutils, wlmutils): exp.stop(orc) assert False + if len(orc.get_address()) < 3: + exp.stop(orc) + assert False + exp.stop(orc) statuses = exp.get_status(orc) assert all([stat == status.STATUS_CANCELLED for stat in statuses])