-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Make test resilient to timing issues #1375
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
Conversation
|
Hmm....
|
|
I also fixed this test in #1345 since it was failing for me sporadically (even on my local machine) , are you sure docker-java logContainerCmd guarantees order? |
|
It must be. I think we need to investigate it further, I'm afraid there is a bug |
|
I think it's actually down to the flush decision in the shell ( Have a look at this (I've annotated for clarity): bash-3.2$ while true; do
> docker run alpine /bin/sh -c "echo -n 'stdout' && echo -n 'stderr' 1>&2"
> echo
> sleep 0.1
> done
stdoutstderr
stdoutstderr
stdoutstderr
stdoutstderr
stdoutstderr
stdoutstderr
stdoutstderr
stderrstdout <--
stdoutstderr
stdoutstderr
stdoutstderr
stdoutstderr
stdoutstderr
stdoutstderr
stdoutstderr
stdoutstderr
stdoutstderr
stdoutstderr
stdoutstderr
stderrstdout <--
stdoutstderr
stdoutstderr
stderrstdout
stdoutstderr
...Interestingly if we repeat this I guess we could modify this test to just use a TTY 🤔... |
|
@rnorth I support the idea of running this test with TTY, at least for the.... demo purpose :D Let's just put a comment above it about the flushing issue |
|
Ergh, enabling TTY in these tests does something bizarre: The three assertions results for the tests involving I think it's fair to say that there is a bug with |
|
@bsideup given that enabling TTY does even worse things for the log order, would you be OK for us to merge this as-is? |
|
@rnorth I have really bad feeling about hiding this bug :( |
No description provided.