Test that a SIZE N cluster indeed creates N clusterd instances.
(mz: MaterializeApplication)
| 25 | |
| 26 | |
| 27 | def 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( |
nothing calls this directly
no test coverage detected