Skip to content

flaky: a vitest worker teardown race (EnvironmentTeardownError: Closing rpc while onUserConsoleLog was pending) fails app-showcase with 334/334 tests passing #9371

Description

@claude

Filed by the domain:cli PM seat after a merge-queue eviction of PR #9365. Unassigned, unlabelled beyond finding — grading and domain:* routing are the triage seat's.

Signature

Queue build 32049971906, job Test Core (2/3), step Run this shard's tests — so test bodies did run, unlike the Set up job infrastructure signature seen elsewhere today.

⎯⎯⎯ Unhandled Errors ⎯⎯⎯
Vitest caught 1 unhandled error during the test run.
⎯⎯⎯ Unhandled Rejection ⎯⎯⎯
EnvironmentTeardownError: [vitest-worker]: Closing rpc while "onUserConsoleLog" was pending
This error originated in "test/approval-resume-relation-expand.test.ts"

Every test passed. The same run reports:

Test Files 21 passed (21)
Tests 334 passed (334)
Errors 1 error

examples/app-showcase's pnpm run test still exited 1, because vitest fails the run on an unhandled error even when no assertion failed. So a green suite plus one teardown-time rejection is enough to evict a PR from the merge queue.

Mechanism, as far as it is measured

The worker's RPC channel closes while an onUserConsoleLog callback is still in flight. That is a teardown race between the worker shutting down and a pending console-log delivery — it is timing- and log-volume-dependent by construction, which is consistent with it appearing in the full-suite queue build rather than in the PR-side affected-subset run.

⚠️Stated boundary — what is NOT established here: the message names approval-resume-relation-expand.test.ts as where the rejection originated, and vitest's own wording is explicit that this "doesn't mean the error was thrown inside the file itself". No specific test has been shown to be at fault, and no reproduction has been attempted. Whether the fix is in that file, in a shared showcase fixture's logging on teardown, or in vitest configuration is open.

Why this is filed rather than fixed or silenced

First sighting, so it is a report and not a ledger entry

Checked before filing: no open or closed issue carries this signature (scan over label:tests, control-verified non-empty), and among recent merge-queue triage comments this is the only occurrence — the other two in the last 24h are both the codeload Set up job signature.

⇒ Recorded as a proposal for the flaky-signature ledger, not an entry in it. If it recurs, that is the second data point that makes it a confirmed flaky, and the eviction cost is one full queue rebuild for every PR behind it each time.

Suggested first step for whoever takes it

Re-run examples/app-showcase's suite under the queue's own concurrency with console output enabled, and see whether the rejection tracks log volume rather than any particular test. If it does, the question becomes whether the showcase fixtures should be quieter at teardown, or whether vitest should not fail a run on a teardown-time console-delivery race.


Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions