Repository navigation
test(stack): fix 1 flaky test in the Realtime catalog check - #7359
Conversation
The Realtime, pg-meta and Studio catalog test hit the 120s test timeout on Podman with only the generator frame to go on. It now runs under a 110s guard that fails with CatalogStallError naming the service and phase in progress, plus that service's launch output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MBEk1PCdaXDCUPR16M9Ria
|
/ai-review Generated by Claude Code |
There was a problem hiding this comment.
Superseded by a newer AI review
🤖 AI Review
Verified all four reported findings and merged the duplicate timeout reports. Confirmed one minor cleanup-diagnostic issue and two diagnostic nits. Updated stale line references to match the checked-out code.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| 🟡 MINOR | packages/stack/src/services/Realtime.integration.test.ts:211 |
test-reliability |
claude+codex | The timeout guard waits for scoped finalization, so a hanging teardown can prevent CatalogStallError from reaching the test runner before its timeout. |
| ⚪ NIT | packages/stack/src/services/Realtime.integration.test.ts:209 |
diagnostics |
claude | Some phase labels identify a narrower operation than the work actually running, which can misdirect stall diagnosis. |
| ⚪ NIT | packages/stack/src/services/Realtime.integration.test.ts:43 |
correctness |
claude | Decoding each output chunk independently can corrupt split UTF-8 characters, and trimming by UTF-16 code units can leave a dangling surrogate. |
Stats
Claude findings: 3 · Codex findings: 1 · Confirmed: 3 · Refuted: 0 · Uncertain: 0
Models: claude-opus-5-5 + gpt-6.1-sol · Trigger: manual · Workflow run
This review runs once per PR. A maintainer can request another with a /ai-review comment.
There was a problem hiding this comment.
🤖 AI Review
Merged four findings into three. Confirmed the phase-label and UTF-8 decoding nits. The cleanup-timeout concern remains uncertain: scope placement and unbounded cleanup are verified, but the pinned Effect implementation is unavailable, and the patched Vitest runner complicates the claimed diagnostic loss.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| 🟡 MINOR | packages/stack/src/services/Realtime.integration.test.ts:211 |
test-diagnostics |
claude+codex | Stalled scope cleanup may prevent the 110-second guard from surfacing CatalogStallError before Vitest's 120-second timeout. |
| ⚪ NIT | packages/stack/src/services/Realtime.integration.test.ts:35 |
test-diagnostics |
claude | Filesystem root setup is labeled 'database recipe', so a stall during that setup would identify the wrong phase. |
| ⚪ NIT | packages/stack/src/services/Realtime.integration.test.ts:43 |
correctness |
codex | Decoding each output chunk with a fresh TextDecoder corrupts UTF-8 characters split across chunk boundaries. |
Stats
Claude findings: 2 · Codex findings: 2 · Confirmed: 2 · Refuted: 0 · Uncertain: 1
Models: claude-opus-5-5 + gpt-6.1-sol · Trigger: auto · Workflow run
This review runs once per PR. A maintainer can request another with a /ai-review comment.
The guard now joins a detached body under its deadline, so a teardown that hangs during interruption cannot delay the stall report. Phase labels cover root setup, the pg-meta relay and scope teardown, and launch output is decoded as a stream per channel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MBEk1PCdaXDCUPR16M9Ria
Flaky test check: ✅ no flaky testsCommit Each execution is a separate Vitest process; |
CLI benchmark (Lightweight Commands): no changes foundCommit
API calls: unchanged for all 7 commands. Binary size: 134.0 MB, unchanged. Details: timing ranges, API calls per command, slowest phasesTiming ranges
API calls per command
Slowest phasesNo command moved beyond noise, so there are no phase deltas. Comment |
Coly010
left a comment
There was a problem hiding this comment.
LGTM, thanks! small optional one: on a stall the message only carries the stalled service's output, so if Realtime readiness stalls because postgres died, the bit that explains it isn't there. might be worth appending the database output too
Realtime, pg-meta and Studio all depend on the owned database, so a stall in one of them now also reports the database's launch output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MBEk1PCdaXDCUPR16M9Ria
|
@Coly010 thanks, done in c15f5ba: when a non-database phase stalls, the error now includes the database's output after the stalled service's. Generated by Claude Code |
…base#7318) ## TL;DR The Mailpit launch test hung on Podman without saying where. It now fails within its timeout, naming the phase that stalled and Mailpit's output. The detached stall guard it uses is now one shared test helper, `failOnStall`, which the Realtime and native owner-logs tests also use. - `Mail.integration.test.ts › launches the real Mailpit recipe and serves its HTTP endpoint`: on Podman, the test hit the 30s test timeout with no diagnostic. The error frame pointed at `sendTestEmail`, but this test never sends mail, so that frame is misleading. The test waits on start, readiness and a `/readyz` request. Container readiness may wait up to 60s, longer than the test timeout, and the `/readyz` request has no bound. So a stall in any of the three looked the same. The whole test scope now runs under one 25s guard inside the 30s test timeout, and a `Ref` tracks the current phase. The test also collects the recipe's log stream, so a stall fails with `MailStallError` naming the phase and showing Mailpit's output so far. - `packages/stack/tests/stall-guard.ts` adds `failOnStall(duration, onStall)`. It joins the guarded effect from a detached fiber, so the stall error surfaces at the deadline instead of waiting for teardown, and it interrupts the stalled fiber in the background so scoped cleanup still runs. `Mail`, `Realtime` (supabase#7359) and `Owner.logs` (supabase#7434) integration tests now share it instead of carrying three copies; each keeps its own stall message. ## ref spotted in: - https://github.com/supabase/cli/actions/runs/39920135558/job/120303098411 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com>
TL;DR
The Realtime, pg-meta and Studio catalog test hung on Podman without saying where. It now fails before the test timeout, naming the service and phase that stalled and that service's output.
Realtime.integration.test.ts › serves Realtime, pg-meta, and Studio against the owned database: on Podman, the test hit the 120s test timeout with only the generator start frame as a clue. The test runs four services in sequence (database, Realtime, pg-meta, Studio), each with a recipe, start, readiness and HTTP step, so a stall anywhere looked the same. The cause is still unknown, so this change is a diagnostic. The scoped body now runs under a 110s guard. Each step records its phase, and each recipe's launch output is collected. A stall fails withCatalogStallErrornaming the service and phase in progress (including stop and root cleanup) and the last part of that service's output.ref
spotted in:
Generated by Claude Code