ci: make the Console SQL suite survive a degraded agent - #38797
Conversation
Every test in the console SQL suite carries a wall-clock budget sized against a healthy agent, and one test additionally budgets its subscribe snapshot at a fixed second. Build 134474 landed on an agent that ran 6-12x slow and four tests failed: three on the 45 second per-test timeout, and `useClustersDropdown subscribe` on an empty snapshot. The dilation was uniform across work Materialize does and work it does not, so the cause was the agent rather than the code under test. Comparing that build against the previous passing run of the same suite, `yarn install`'s fetch step went from 5.3 to 32.1 seconds and its link step from 7.8 to 51.3 seconds, the testdrive reset's median went from 0.36 to 4.42 seconds across the same 87 resets, and the suite as a whole went from 147.9 to 1281.8 seconds. Make the dropdown test poll the subscribe cursor until the cluster it asserts on arrives, instead of reading one one-second FETCH window and asserting on whatever that returned. Optimizing the subscribe and computing its snapshot is work whose duration the test does not control, and peek optimization alone reached 2.3 seconds in that run, so the old budget could not hold. The poll stops at 30 seconds, below the suite's `testTimeout`, so a snapshot that genuinely never arrives still fails on the assertion and names the missing cluster. Retry the step once for the rest. Their budgets are not the problem: a dilated run already spends 25.5 of the step's 30 minutes, so raising them converts test failures into step timeouts, and the suite's largest fixed cost, 403 seconds of catalog resets in that run, is too small to close a gap that size. A retry does mean a genuine console regression is attempted twice before the step goes red. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
d750ed8 to
6425004
Compare
QA LLM Review (Post Merge)@antiguru — an automated review of commit 1. MEDIUM -- Declaring
|
|
Confirmed, and it is wider than this step. Fix in #38808, taking the second option: Applying the old and the new function to every checked-in template, thirteen steps were silently missing rules, not just this one:
After the change every step in every template carries all four with no duplicates. Re-listing inside a step stays correct and is now redundant rather than required, so I left the existing re-listings alone. Posted by Claude Code on behalf of antiguru. |
) `set_retry_on_agent_lost` gives every step four automatic retries for failures that belong to the infrastructure rather than the step: a lost agent, an agent stopped by the OS, exit 128 for a registry or GHCR hiccup, and exit 199 for a Rust ICE. It skipped any step that declared `retry.automatic` of its own: ```python retry = step.setdefault("retry", {}) if "automatic" in retry: continue ``` So a step asking for one extra rule lost all four rather than gaining a fifth. Nothing reports that, and the step then hard-fails on precisely the transient classes the shared rules exist for. The loss is worth more than it looks. `ci/plugins/mzcompose/hooks/command` deliberately propagates 128 and 199 out of a job rather than collapsing them to 1, with a comment saying that overwriting them "turns a self-healing infra failure into a job that stays red until someone retries it by hand", and `mzbuild.py` exits 128 when a required image cannot be pulled. A step that overrode the rules went red on the first failed image pull where every other step retried twice — the MinIO Docker Hub outage fixed in #38802 is exactly that shape. Merge instead of skip, adding only the rules a step does not already declare, and leave a step that retries on every exit status alone since it covers them already. ### What regains coverage Applying the old and new function to every checked-in template, thirteen steps were silently missing rules: | pipeline | steps | was missing | |---|---|---| | test | `devel-docker-tags`, `console-sql-test` | all four | | test | `check-merge-with-target` | agent-lost only, having re-listed the other three by hand | | nightly | `devel-docker-tags`, `aws-real`, `aws-glue-schema-registry-real`, 4× `k8s-node-recovery-*`, `terraform-aws-upgrade`, `terraform-azure` | all four | | spec-sheet | `devel-docker-tags` | all four | After the change every step in every template carries all four, with no duplicated rules. The `ci/deploy` steps retry on `exit_status: "*"` and are left untouched. Re-listing the shared rules inside a step stays correct and is now redundant rather than required; I left the existing re-listings in place rather than widen the diff. Found by the post-merge QA review on #38797. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Every test in the console SQL suite carries a wall-clock budget sized against a healthy agent, and one test additionally budgets its subscribe snapshot at a fixed second. Build 134474 landed on an agent that ran 6-12x slow and four tests failed: three on the 45 second per-test timeout, and
useClustersDropdown subscribeon an empty snapshot. The dilation was uniform across work Materialize does and work it does not, so the cause was the agent rather than the code under test.Comparing that build against the previous passing run of the same suite, on the same branch and the same 87 testdrive resets:
yarn installfetch stepyarn installlink stepyarn installnever touches Materialize and still slowed 6x, which is what rules out a regression in the code under test.Make the dropdown test poll the subscribe cursor until the cluster it asserts on arrives, instead of reading one one-second
FETCHwindow and asserting on whatever that returned. Optimizing the subscribe and computing its snapshot is work whose duration the test does not control, and peek optimization alone reached 2.3 seconds in that run, so the old budget could not hold. The poll stops at 30 seconds, below the suite'stestTimeout, so a snapshot that genuinely never arrives still fails on the assertion and names the missing cluster.Retry the step once for the rest. Their budgets are not the problem: a dilated run already spends 25.5 of the step's 30 minutes, so raising them converts test failures into step timeouts, and the suite's largest fixed cost, 403 seconds of catalog resets in that run, is too small to close a gap that size. A retry does mean a genuine console regression is attempted twice before the step goes red.
Modified
console/src/platform/shell/useClusterDropdown.test.sql.ts, the test that was failing. No new tests: the change makes an existing test wait on the signal it asserts on rather than on the clock.🤖 Generated with Claude Code