Skip to content

Commit 329b57a

Browse files
committed
test: adjust cloudtest to changed process names
Orchestrator processes now have changed names, as a result of the previous commit that made replica IDs into user/stytem enums. Previously, process names had the form: * cluster-u{x}-replica-{y}-{i} * cluster-s{x}-replica-{y}-{i} The new format is: * cluster-u{x}-replica-u{y}-{i} * cluster-s{x}-replica-s{y}-{i} This commit adjusts cloudtests to work with the new format.
1 parent 5753c36 commit 329b57a

File tree

8 files changed

+14
-24
lines changed

8 files changed

+14
-24
lines changed

doc/developer/cloudtest.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ is instantiated once per `pytest` invocation
153153
```
154154
from materialize.cloudtest.util.wait import wait
155155
156-
wait(condition="condition=Ready", resource="pod/compute-cluster-1-replica-1-0")
156+
wait(condition="condition=Ready", resource="pod/compute-cluster-u1-replica-u1-0")
157157
```
158158

159159
`wait` uses `kubectl wait` behind the scenes. Here is what the `kubectl wait`

doc/developer/guide-tokio-console.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ different processes, e.g.:
2525

2626
```text
2727
environmentd: [...] INFO mz_ore::tracing: starting tokio console on http://127.0.0.1:6669
28-
compute-cluster-u1-replica-1: [...] INFO mz_ore::tracing: starting tokio console on /var/folders/30/[...]3ee9
29-
compute-cluster-s1-replica-2: [...] INFO mz_ore::tracing: starting tokio console on /var/folders/30/[...]f5b6
30-
compute-cluster-s2-replica-3: [...] INFO mz_ore::tracing: starting tokio console on /var/folders/30/[...]7af2
28+
compute-cluster-u1-replica-u1: [...] INFO mz_ore::tracing: starting tokio console on /var/folders/30/[...]3ee9
29+
compute-cluster-s1-replica-s1: [...] INFO mz_ore::tracing: starting tokio console on /var/folders/30/[...]f5b6
30+
compute-cluster-s2-replica-s2: [...] INFO mz_ore::tracing: starting tokio console on /var/folders/30/[...]7af2
3131
```
3232

3333
Then, in a different tmux pane/terminal, run the `tokio-console` command with the listen address of

misc/python/materialize/cloudtest/app/materialize_application.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,15 @@ def start_metrics_server(self) -> None:
111111
)
112112

113113
def wait_resource_creation_completed(self) -> None:
114-
wait(condition="condition=Ready", resource="pod/cluster-u1-replica-1-0")
114+
wait(condition="condition=Ready", resource="pod/cluster-u1-replica-u1-0")
115115

116116
def wait_replicas(self) -> None:
117117
# NOTE[btv] - This will need to change if the order of
118118
# creating clusters/replicas changes, but it seemed fine to
119119
# assume this order, since we already assume it in `create`.
120-
wait(condition="condition=Ready", resource="pod/cluster-u1-replica-1-0")
121-
wait(condition="condition=Ready", resource="pod/cluster-s1-replica-2-0")
122-
wait(condition="condition=Ready", resource="pod/cluster-s2-replica-3-0")
120+
wait(condition="condition=Ready", resource="pod/cluster-u1-replica-u1-0")
121+
wait(condition="condition=Ready", resource="pod/cluster-s1-replica-s1-0")
122+
wait(condition="condition=Ready", resource="pod/cluster-s2-replica-s2-0")
123123

124124
def wait_for_sql(self) -> None:
125125
"""Wait until environmentd pod is ready and can accept SQL connections"""

misc/python/materialize/cloudtest/util/cluster.py

-10
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,8 @@
99

1010

1111
def cluster_pod_name(cluster_id: str, replica_id: str, process: int = 0) -> str:
12-
# Replica IDs now appear as `GlobalId`s in `mz_cluster_replicas`, while
13-
# the pod names still contain only the numeric ID.
14-
# TODO(teskje): Change pod names to contain the replica `GlobalId`.
15-
replica_id = replica_id.lstrip("u")
16-
1712
return f"pod/cluster-{cluster_id}-replica-{replica_id}-{process}"
1813

1914

2015
def cluster_service_name(cluster_id: str, replica_id: str) -> str:
21-
# Replica IDs now appear as `GlobalId`s in `mz_cluster_replicas`, while
22-
# the pod names still contain only the numeric ID.
23-
# TODO(teskje): Change pod names to contain the replica `GlobalId`.
24-
replica_id = replica_id.lstrip("u")
25-
2616
return f"service/cluster-{cluster_id}-replica-{replica_id}"

test/cloudtest/test_crash.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ def restarts(p: V1Pod) -> int:
113113

114114
def get_replica() -> Tuple[V1Pod, V1StatefulSet]:
115115
"""Find the stateful set for the replica of the default cluster"""
116-
compute_pod_name = "cluster-u1-replica-1-0"
117-
ss_name = "cluster-u1-replica-1"
116+
compute_pod_name = "cluster-u1-replica-u1-0"
117+
ss_name = "cluster-u1-replica-u1"
118118
compute_pod = mz.environmentd.api().read_namespaced_pod(
119119
compute_pod_name, mz.environmentd.namespace()
120120
)

test/cloudtest/test_smoke.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
def test_wait(mz: MaterializeApplication) -> None:
17-
wait(condition="condition=Ready", resource="pod/cluster-u1-replica-1-0")
17+
wait(condition="condition=Ready", resource="pod/cluster-u1-replica-u1-0")
1818

1919

2020
def test_sql(mz: MaterializeApplication) -> None:

test/cloudtest/test_system_clusters.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ def test_system_clusters(mz: MaterializeApplication) -> None:
2828
"""Confirm that the system clusters have the expected labels and selectors"""
2929
mz.wait_replicas()
3030

31-
assert_pod_properties(mz, "cluster-s1-replica-2-0")
32-
assert_pod_properties(mz, "cluster-s2-replica-3-0")
31+
assert_pod_properties(mz, "cluster-s1-replica-s1-0")
32+
assert_pod_properties(mz, "cluster-s2-replica-s2-0")

test/cloudtest/test_upgrade.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def test_upgrade(
5656
log_filter=log_filter,
5757
release_mode=(not dev),
5858
)
59-
wait(condition="condition=Ready", resource="pod/cluster-u1-replica-1-0")
59+
wait(condition="condition=Ready", resource="pod/cluster-u1-replica-u1-0")
6060

6161
executor = CloudtestExecutor(application=mz, version=LAST_RELEASED_VERSION)
6262
scenario = CloudtestUpgrade(checks=Check.__subclasses__(), executor=executor)

0 commit comments

Comments
 (0)