Skip to content

Commit

Permalink
Small test fixes (#1574)
Browse files Browse the repository at this point in the history
  • Loading branch information
carolineechen authored Dec 11, 2024
1 parent b26725c commit e960dbd
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions tests/test_resources/test_clusters/test_on_demand_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
import runhouse as rh

from runhouse.globals import rns_client
from runhouse.resources.hardware.utils import ClusterStatus, RunhouseDaemonStatus
from runhouse.resources.hardware.utils import (
ClusterStatus,
LauncherType,
RunhouseDaemonStatus,
)

import tests.test_resources.test_clusters.test_cluster
from tests.constants import TESTING_AUTOSTOP_INTERVAL
Expand Down Expand Up @@ -192,8 +196,6 @@ def test_autostop_call_updated(self, cluster):
time.sleep(TESTING_AUTOSTOP_INTERVAL)
last_active_time = get_last_active_time_without_register(cluster)

cluster.call("autostop_env", "config")

# check that last time updates within the next 10 sec
end_time = time.time() + TESTING_AUTOSTOP_INTERVAL
while time.time() < end_time:
Expand Down Expand Up @@ -240,10 +242,16 @@ def test_cluster_ping_and_is_up(self, cluster):

original_ips = cluster.ips

cluster._cluster_status = ClusterStatus.TERMINATED
if cluster.launcher == LauncherType.DEN:
cluster._cluster_status = ClusterStatus.TERMINATED
assert not cluster.is_up()
cluster._cluster_status = None

# test ping w/o retry fails with empty ips
cluster.compute_properties["ips"] = []
cluster.compute_properties["internal_ips"] = []
assert not cluster._ping(retry=False)

cluster._cluster_status = None
if cluster.compute_properties.get("cloud") == "kubernetes":
# kubernetes does not use ips in command runner
cluster.compute_properties["ips"] = ["00.00.000.11"]
Expand Down

0 comments on commit e960dbd

Please sign in to comment.