From 52bdd727e38e302f4a33d90856c305b4f9de160b Mon Sep 17 00:00:00 2001 From: Jan Teske Date: Wed, 14 Feb 2024 10:39:15 +0100 Subject: [PATCH] test/cluster: unflake test-compute-controller-metrics The compute controller now only refreshed its metrics once per second, which makes it more likely that test-compute-controller-metrics, which runs some SQL and then checks for that to be reflected in the metrics, gets to see outdated values. The only way we can solve this is by sleeping before querying the metrics. Given the 1s refresh interval, sleeping for 2s should be enough. --- test/cluster/mzcompose.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/cluster/mzcompose.py b/test/cluster/mzcompose.py index f7178f0cdcee2..b74d1eb82488d 100644 --- a/test/cluster/mzcompose.py +++ b/test/cluster/mzcompose.py @@ -68,12 +68,10 @@ def workflow_default(c: Composition, parser: WorkflowArgumentParser) -> None: for i, name in enumerate(c.workflows): # incident-70 requires more memory, runs in separate CI step # concurrent-connections is too flaky - # TODO: Reenable test-compute-controller-metrics when #25214 is fixed if name in ( "default", "test-incident-70", "test-concurrent-connections", - "test-compute-controller-metrics", ): continue if buildkite.accepted_by_shard(i): @@ -2427,6 +2425,9 @@ def fetch_metrics() -> Metrics: index_id = c.sql_query("SELECT id FROM mz_indexes WHERE name = 'idx'")[0][0] mv_id = c.sql_query("SELECT id FROM mz_materialized_views WHERE name = 'mv'")[0][0] + # Wait a bit to let the controller refresh its metrics. + time.sleep(2) + # Check that expected metrics exist and have sensible values. metrics = fetch_metrics()