Skip to content
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: keep stderr and stdout from interleaving #589

Closed
wants to merge 1 commit into from

Conversation

henryiii
Copy link
Contributor

I think this fixes #587.

@henryiii henryiii changed the title fix: keep stderr and stdout from enterleaving fix: keep stderr and stdout from interleaving Feb 11, 2021
@YannickJadoul YannickJadoul reopened this Feb 11, 2021
@henryiii
Copy link
Contributor Author

Looks like circleCI is still getting the pre-fix test/test_docker_images.py . Odd.

@YannickJadoul
Copy link
Member

Looks like circleCI is still getting the pre-fix test/test_docker_images.py . Odd.

We've seen CircleCI act weirdly (or at least different from others) on these kinds of things, before, no? It also didn't restart automatically after closing-reopening.

@YannickJadoul
Copy link
Member

Is there a way to check this? If so, this can be merged without further input, I'd say :-)

@joerick
Copy link
Contributor

joerick commented Feb 12, 2021

I have seen something similar to this before when I was doing the fold groups work, at the time I thought it was a Github actions bug... I might do a little testing to investigate...

@joerick
Copy link
Contributor

joerick commented Feb 12, 2021

I don't believe this PR fixes the problem. See this GHA run:
https://github.com/joerick/gha-testing/runs/1888060360?check_suite_focus=true

These examples try to print interleved stdout/stderr messages. So perfect output would look like:

1
stderr 1
2
stderr 2
3
stderr 3
4
stderr 4
...

As you can see, regardless of the ways I try to disable output buffering, there are still occasionally problems.

It seems to me that this is an inherent problem within GHA. Or perhaps there's a buffer somewhere that we haven't found the controls for yet?

@henryiii
Copy link
Contributor Author

https://github.saobby.my.eu.orgmunity/t/stdout-stderr-output-not-in-correct-order-in-logs/16335

Maybe we could redirect stderr to stdout on GHA? Is there really a difference in GHA? (In fact, is there really a difference in any logging system?)

@henryiii henryiii marked this pull request as draft February 12, 2021 16:08
@joerick
Copy link
Contributor

joerick commented Feb 13, 2021

Yeah, we could do that. I actually don't think there's any difference between stdout and stderr on CI. I had implemented something like this when I was working on the fold group stuff. The only snag is that some of our tests understand the difference between out/err. But they could be worked around fairly easily.

btw, in our case, we also have to redirect the subprocesses stderr to stdout.

@joerick
Copy link
Contributor

joerick commented Apr 23, 2021

Just doing some tidying of PRs, so closing this one.

A simple fix for this would be to add 2>&1 to our sample configs. But that might just cause confusion. Otherwise, it's a refactoring to direct our logs to only stdout, perhaps just when CI=1 - and figure out how to manage this in the print-build-identifier tests

@joerick joerick closed this Apr 23, 2021
@henryiii henryiii deleted the fix/mixedout branch June 6, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output mangled
3 participants