testcontainers-rs icon indicating copy to clipboard operation
testcontainers-rs copied to clipboard

feat!: support waiting from both standard streams

Open DDtKey opened this issue 1 year ago • 3 comments

Might be useful to avoid duplication in some cases

DDtKey avatar Jul 07 '24 17:07 DDtKey

Deploy Preview for testcontainers-rust ready!

Name Link
Latest commit 73059717436fea886253df012fd94293e63bfd05
Latest deploy log https://app.netlify.com/sites/testcontainers-rust/deploys/668acd4896539900089b90c3
Deploy Preview https://deploy-preview-695--testcontainers-rust.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Jul 07 '24 17:07 netlify[bot]

@DDtKey on a related note, am I right that it's not possible to wait for the command to complete? I see that we can wait for messages to be present in stderr/stdout, or for a specific exit code, but there doesn't seem to be a away to wait until the command finishes regardless of the outcome. There's the timeout option but it sleeps for the whole duration, not circuit breaking when the command is finished.

In my case I wrote a wrapper to execute a SQL statement, and wanted to print whatever error occurred when there was some. The exit code or expected message depended on what the caller was doing (e.g. inserting, deleting, etc) and the exit code could be anything. My workaround was to keep polling until an exit code was available.

ns-sjorgedeaguiar avatar Aug 15 '24 18:08 ns-sjorgedeaguiar

Hi @ns-sjorgedeaguiar Yes, that's correct. however I think more appropriate place for the discussion is https://github.com/testcontainers/testcontainers-rs/issues/702

Where you also can find a workaround. But it's something we can support for sure

DDtKey avatar Aug 15 '24 18:08 DDtKey