Skip to content

Commit a08131f

Browse files
committed
fix(cluster): add 1-hour timeout for cluster acquisition
Previously, the cluster acquisition loop could run indefinitely if a cluster instance was not available. This change introduces a one-hour timeout to prevent hanging tests. If the deadline is reached, a TimeoutError is raised with a descriptive message.
1 parent 825794a commit a08131f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cardano_node_tests/cluster_management/cluster_getter.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,8 +805,13 @@ def get_cluster_instance( # noqa: C901
805805

806806
self.log(f"want to run test '{cget_status.current_test}'")
807807

808-
# Iterate until it is possible to start the test
808+
# Iterate until it is possible to start the test. Timeout after one hour.
809+
deadline = time.monotonic() + 3600
809810
while True:
811+
if time.monotonic() >= deadline:
812+
msg = "Timeout while waiting to obtain cluster instance."
813+
raise TimeoutError(msg)
814+
810815
if cget_status.respin_ready:
811816
self._respin(scriptsdir=scriptsdir)
812817

0 commit comments

Comments
 (0)