Repository navigation
Ignore Vitest teardown errors from late container logs - #1598
Merged
cristianrgreco merged 1 commit intoOct 13, 2026
Merged
Conversation
cristianrgreco
marked this pull request as ready for review
October 13, 2026 10:03
cristianrgreco
deleted the
claude/ignore-late-console-log-teardown-error
branch
October 13, 2026 15:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
Tests (postgresql, 22.x, docker)job on #1590 failed with all 21 tests passing (log):It is unrelated to that PR's diff. The cause:
vitest.config.tssetsDEBUG=testcontainers*, and underNODE_ENV=testthe logger writes throughconsole.log, which Vitest forwards from the worker to the main process over RPC.client connected,adding filterandclient disconnectedfor every worker, so a line can arrive after that worker's own test file has finished.--coverage(CI only), the coverage payload is still in flight when a file's tests finish. Aconsole.logsent in that window is still pending when Vitest closes the worker's RPC, and Vitest reports it as an unhandled error (EnvironmentTeardownError: Closing rpc while "onUserConsoleLog" was pending — intermittent on v4/v5, clean on v3, maxWorkers:1 does not help vitest-dev/vitest#11153).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
onUnhandledErrorfilter that ignores that one error. Reaper logs still stream totestcontainers:containersas 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
client disconnectedline was written throughconsole.login the test worker after the file was done.console.logafter its test finishes, run with--coverage, exited 1 with the error above in 5/5 runs.npm run format,npm run lintandnpm run knippass.Not breaking
Test configuration only. Nothing in the published packages changes.