Make test resilient to timing issues#1375
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.