Skip to content

Commit 16aa0f8

Browse files
Adjust support methods to use exceptions and remove explicit use of mcad parameter in cluster-configuration function (#494)
1 parent 288df46 commit 16aa0f8

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

tests/e2e/support.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import subprocess
55
from kubernetes import client, config
66
import kubernetes.client
7-
import subprocess
87

98

109
def get_ray_image():
@@ -27,10 +26,13 @@ def create_namespace(self):
2726

2827
def create_namespace_with_name(self, namespace_name):
2928
self.namespace = namespace_name
30-
namespace_body = client.V1Namespace(
31-
metadata=client.V1ObjectMeta(name=self.namespace)
32-
)
33-
self.api_instance.create_namespace(namespace_body)
29+
try:
30+
namespace_body = client.V1Namespace(
31+
metadata=client.V1ObjectMeta(name=self.namespace)
32+
)
33+
self.api_instance.create_namespace(namespace_body)
34+
except Exception as e:
35+
return _kube_api_error_handling(e)
3436

3537

3638
def delete_namespace(self):

tests/upgrade/raycluster_sdk_upgrade_test.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class TestMNISTRayClusterUp:
1919
def setup_method(self):
2020
initialize_kubernetes_client(self)
2121
create_namespace_with_name(self, namespace)
22-
cluster_queue = "cluster-queue" # add cluster name here
22+
cluster_queue = "cluster-queue" # add cluster-queue name here
2323
create_local_queue(self, cluster_queue)
2424

2525
def test_mnist_ray_cluster_sdk_auth(self):
@@ -50,25 +50,26 @@ def run_mnist_raycluster_sdk_oauth(self):
5050
instascale=False,
5151
image=ray_image,
5252
write_to_file=True,
53-
mcad=False,
5453
)
5554
)
5655

5756
try:
5857
cluster.up()
5958
cluster.status()
6059
# wait for raycluster to be Ready
61-
cluster.wait_ready()
60+
# cluster.wait_ready() # temporarily broken
61+
sleep(60)
6262
cluster.status()
6363
# Check cluster details
6464
cluster.details()
6565
# Assert the cluster status is READY
6666
_, ready = cluster.status()
67-
assert ready, "Cluster is not ready!"
67+
assert ready
6868

6969
except Exception as e:
7070
print(f"An unexpected error occurred. Error: ", e)
7171
delete_namespace(self)
72+
assert False, "Cluster is not ready!"
7273

7374

7475
class TestMnistJobSubmit:

0 commit comments

Comments
 (0)