-
-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(exec): updates the Multiplexed
opt to combine stdout and stderr
#2452
fix(exec): updates the Multiplexed
opt to combine stdout and stderr
#2452
Conversation
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
d4d6948
to
9df5c43
Compare
Updates the `Multiplexed` option to combine the output of stdout and stderr, changing the previous behavior where stderr was preferred over stdout. Now, both streams are properly combined into a single stream. Additionally, this commit enhance and adjust existing test cases for the `Multiplexed` option: * Modifies `TestExecWithMultiplexedResponse` to ensure that stdout and stderr are on the same stream, testing the new behavior of the `Multiplexed` option. * Refactors `TestExecWithNonMultiplexedResponse` to use `stdcopy.StdCopy` for ensuring that `io.Reader` contains a separated stdout and stderr.
9df5c43
to
9a11a36
Compare
* main: bug:Fix AMQPS url (testcontainers#2462) chore: more compose updates in comments chore: use "docker compose" (v2) instead of "docker-compose" (v1) (testcontainers#2464) chore(deps): bump github/codeql-action from 2.22.12 to 3.24.9 (testcontainers#2459)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you for contributing this nice improvement.
While reviewing the PR I added a commit on top removing the provider type from the containers in the tests, to avoid causing you more noise for this PR. Please take a look, you'll see it very simple, although not related, but they make the code more readable.
Once the CI passes, I'll merge it to include it in the upcoming releae
Cheers!
} else { | ||
opts.Reader = &outBuff | ||
} | ||
opts.Reader = io.MultiReader(&outBuff, &errBuff) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! multireader for the win!
* main: (115 commits) chore: create TLS certs in a consistent manner (testcontainers#2478) chore(deps): bump idna from 3.6 to 3.7 (testcontainers#2480) Elasticsearch disable CA retrieval when ssl is disabled (testcontainers#2475) fix: handle dockerignore exclusions properly (testcontainers#2476) chore: prepare for next minor development cycle (0.31.0) chore: use new version (v0.30.0) in modules and examples Fix url creation to handle query params when using HTTP wait strategy (testcontainers#2466) fix: data race on container run (testcontainers#2345) fix: logging deadlock (testcontainers#2346) feat(k6):Add remote test scripts (testcontainers#2350) feat: optimizes file copies to and from containers (testcontainers#2450) fix(exec): updates the `Multiplexed` opt to combine stdout and stderr (testcontainers#2452) Upgrade neo4j module to use features from v0.29.1 of testcontainers-go (testcontainers#2463) bug:Fix AMQPS url (testcontainers#2462) chore: more compose updates in comments chore: use "docker compose" (v2) instead of "docker-compose" (v1) (testcontainers#2464) chore(deps): bump github/codeql-action from 2.22.12 to 3.24.9 (testcontainers#2459) refactor: Add Weaviate modules tests (testcontainers#2447) feat(exitcode): Add exit code sugar method (testcontainers#2342) feat: add module to support InfluxDB v1.x (testcontainers#1703) ...
What does this PR do?
Updates the
Multiplexed
option to combine the output of stdout and stderr, changing the previous behavior where stderr was preferred over stdout. Now, both streams are properly combined into a single stream.Why is it important?
Previously, the
Multiplexed
option prioritized stderr over stdout, potentially leading to unexpected results. By updating it to combine both stdout and stderr into a single stream, we ensure consistency and accuracy in handling the output of executed commands. This change prevents potential confusion or errors resulting from the previous preference for stderr over stdout.Related issues