Repository navigation
test(stack): fix 1 flaky Mailpit test and share the stall guard - #7318
Conversation
The launch test now bounds start, readiness and the /readyz request inside the test timeout and fails with the phase and Mailpit's output so far, instead of a bare test timeout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EMySvvbM4B1zdmhw3pp1wA
|
/ai-review Generated by Claude Code |
Flaky test check: ✅ no flaky testsCommit Each execution is a separate Vitest process; |
There was a problem hiding this comment.
Superseded by a newer AI review
🤖 AI Review
Claude reported one potential test-flakiness issue; Codex reported none. The reduced readiness budget is verified, but whether it causes otherwise successful Mailpit runs to fail remains uncertain. Tests were not run.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| 🟡 MINOR | packages/stack/src/services/Mail.integration.test.ts:107 |
test-flakiness |
claude | The fixed six-second readiness timeout can reject slow Mailpit startups that would previously have completed within the overall 30-second test timeout, potentially increasing flakiness on Podman. |
Stats
Claude findings: 1 · Codex findings: 0 · Confirmed: 0 · 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.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EMySvvbM4B1zdmhw3pp1wA
There was a problem hiding this comment.
🤖 AI Review
Both independent reviews completed. Confirmed Claude’s readiness-timeout concern and UTF-8 diagnostic decoding defect. Codex reported no findings. Neither issue changes production behavior.
Findings
| Severity | Location | Category | Sources | Claim |
|---|---|---|---|---|
| 🟡 MINOR | packages/stack/src/services/Mail.integration.test.ts:107 |
test-flakiness |
claude | The six-second readiness timeout can fail a healthy but slower container even when most of the test’s 30-second budget remains. |
| 🟡 MINOR | packages/stack/src/services/Mail.integration.test.ts:98 |
correctness |
claude | Decoding every log chunk with a fresh TextDecoder corrupts UTF-8 characters split across chunks in the timeout diagnostics. |
Stats
Claude findings: 2 · Codex findings: 0 · Confirmed: 2 · 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.
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.
one ask: the guard sits inside the Effect.scoped, so when it fires, the docker teardown (docker stop with its default 10s grace, then rm --force) runs before MailStallError surfaces. on a slow engine, which i think is the likely cause of this hang, that pushes past 30s and vitest reports the plain timeout again, with the stall error only in the logs afterwards. could this use the same detached-join shape as #7359 around the whole scope? (might be worth a shared tests/ helper at that point since #7434 has the same shape, but totally fine if you'd rather not)
approving so you're unblocked, otherwise looks good to me!
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EMySvvbM4B1zdmhw3pp1wA
|
Good catch, thanks. 6e5ecdb (not yet pushed) uses the detached-join shape from #7359 around the whole I left out the shared Generated by Claude Code |
Mail, Realtime and native owner-logs now use one failOnStall helper that fails at the deadline without waiting for the stalled scope's finalizers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 atsendTestEmail, but this test never sends mail, so that frame is misleading. The test waits on start, readiness and a/readyzrequest. Container readiness may wait up to 60s, longer than the test timeout, and the/readyzrequest 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 aReftracks the current phase. The test also collects the recipe's log stream, so a stall fails withMailStallErrornaming the phase and showing Mailpit's output so far.packages/stack/tests/stall-guard.tsaddsfailOnStall(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(test(stack): fix 1 flaky test in the Realtime catalog check #7359) andOwner.logs(test(stack): fix 1 flaky test in the native owner-logs check #7434) integration tests now share it instead of carrying three copies; each keeps its own stall message.ref
spotted in:
🤖 Generated with Claude Code