Repository navigation
Replace hand-rolled stream handling with Node stream built-ins - #1566
Merged
Merged
Conversation
Follows the k3s change in #1503.
This was referenced Oct 12, 2026
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
Follows the k3s change in #1503 and replaces the remaining hand-rolled stream collection with
node:stream/consumersandnode:stream/promises.runInContainerreads the container output withtext().putArchiveno longer drains the dockerode response. dockerode 5 buffers it before resolving, so the drain was a no-op.streamToStringis removed, as those were its only two callers.text(). A log stream error is now caught by the existingcatch.saveRecordingextracts the archive withpipeline(), so a corrupt archive or a failed source stream rejects instead of hanging.Verification
npm run format,npm run lint,npm run knip,npm run check-compiles: pass.npx vitest runonrun-in-container.test.ts,http-wait-strategy.test.tsandgeneric-container.test.ts: 69 passed, 1 skipped.npx vitest run packages/modules/selenium/src/selenium-container.test.ts: 6 passed.pipeline(source, tar.extract(dest))extracts atar-fsarchive and rejects on a corrupt archive and on a source error.Not breaking
streamToStringwas internal and never exported from the packageindex.ts. The HTTP wait strategy error message keeps its format; the logs are now trimmed as a whole instead of per chunk.