Skip to content

Ignore Vitest teardown errors from late container logs - #1598

Merged
cristianrgreco merged 1 commit into
mainfrom
claude/ignore-late-console-log-teardown-error
Oct 13, 2026
Merged

cristianrgreco merged 1 commit into
mainfrom
claude/ignore-late-console-log-teardown-error

Conversation

@cristianrgreco

Copy link
Copy Markdown
Collaborator

Summary

The Tests (postgresql, 22.x, docker) job on #1590 failed with all 21 tests passing (log):

EnvironmentTeardownError: [vitest-worker]: Closing rpc while "onUserConsoleLog" was pending
This error originated in "packages/modules/postgresql/src/postgresql-container-snapshot.test.ts" test file.

It is unrelated to that PR's diff. The cause:

The failed log doesn't show which line was pending. The timing fits: the timescale file finished at 47.8s and the snapshot file at 48.4s.

This adds an onUnhandledError filter that ignores that one error. Reaper logs still stream to testcontainers:containers as before, and no library code changes. The error only carries the RPC method name, so the filter can't be narrowed to reaper lines.

Verification

  • Mechanism: a scratch test started an isolated Ryuk and disconnected a second client 1s after the file's tests finished. The client disconnected line was written through console.log in the test worker after the file was done.
  • Red: a scratch test file that keeps calling console.log after its test finishes, run with --coverage, exited 1 with the error above in 5/5 runs.
  • Green: with this change the same file exited 0 in 5/5 runs.
  • Other errors still fail: a scratch test with an unhandled rejection after the file finishes still exits 1.
  • npm run format, npm run lint and npm run knip pass.

Not breaking

Test configuration only. Nothing in the published packages changes.

@cristianrgreco cristianrgreco added maintenance Improvements that do not change functionality patch Backward compatible bug fix labels Oct 13, 2026
@cristianrgreco
cristianrgreco marked this pull request as ready for review October 13, 2026 10:03
@cristianrgreco
cristianrgreco merged commit 924507f into main Oct 13, 2026
191 checks passed
@cristianrgreco
cristianrgreco deleted the claude/ignore-late-console-log-teardown-error branch October 13, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Improvements that do not change functionality patch Backward compatible bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant