gotestyourself / gotestsum

'go test' runner with output optimized for humans, JUnit XML for CI integration, and a summary of the test results.
Apache License 2.0
2.03k stars 119 forks source link

dotsv2: Go test stderr clobbers the outpout #356

Closed howardjohn closed 1 year ago

howardjohn commented 1 year ago

Example: https://asciinema.org/a/NpEIGQp4PCvKVrSxfHubhEN2T

You can see for a split second an error is emitted directly to stderr. We then overwrite it, but our "clearLines" attempt it broken since it doesn't account for it. As a result, I end up with a floating pkg/test indefinitely.

We will need to capture stderr and display it in the dotswriter most likely? Or something along those lines.

dnephin commented 1 year ago

Thank you for the bug report! Capturing the stderr seems like the right approach. We'll display it as part of the summary anyway, so we could even discard it. I opened #358 which does the discard, but I haven't had a chance to test it.

If you confirm this forks for you I can merge it.