MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / test_cluster_sizing

Function test_cluster_sizing

test/cloudtest/test_compute.py:27–48  ·  view source on GitHub ↗

Test that a SIZE N cluster indeed creates N clusterd instances.

(mz: MaterializeApplication)

Source from the content-addressed store, hash-verified

25
26
27def test_cluster_sizing(mz: MaterializeApplication) -> None:
28 """Test that a SIZE N cluster indeed creates N clusterd instances."""
29 SIZE = 2
30
31 mz.environmentd.sql(
32 f"CREATE CLUSTER sized1 REPLICAS (sized_replica1 (SIZE 'scale={SIZE},workers=1'))"
33 )
34 cluster_id = mz.environmentd.sql_query(
35 "SELECT id FROM mz_clusters WHERE name = 'sized1'"
36 )[0][0]
37 assert cluster_id is not None
38
39 replica_id = mz.environmentd.sql_query(
40 "SELECT id FROM mz_cluster_replicas WHERE name = 'sized_replica1'"
41 )[0][0]
42 assert replica_id is not None
43
44 for compute_id in range(0, SIZE):
45 compute_pod = cluster_pod_name(cluster_id, replica_id, compute_id)
46 wait(condition="condition=Ready", resource=compute_pod)
47
48 mz.environmentd.sql("DROP CLUSTER sized1 CASCADE")
49
50
51@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 4

cluster_pod_nameFunction · 0.90
waitFunction · 0.90
sqlMethod · 0.45
sql_queryMethod · 0.45

Tested by

no test coverage detected