Open asanakoy opened 7 years ago
The easy fix is to add sys.stdout.flush()
at the end of the main.
Looks like the problem is because of the concurrency.
I believe something like sys.stdout.flush(); sys.stderr.flush()
must be added somewhere in the guts just before sacred dimps std/stderr outputs the last time before finishing.
This is a recurring non-deterministic issue, and honestly, I have no idea why it happens. I'm thoroughly flushing stdout and stderr here. And in general I've tried to be very careful with flushing and closing all involved streams. If you have any ideas what I have overlooked, please let me know.
Several issues with stdout capturing have been resolved recently, so I'd be surprised if the failure rate is still 40%. But there remains a problem somewhere. (see also #289)
Sacred version:
0.7.1
Python:2.7.11
Ubuntu14.04
2 out of 5 times the field
captured_out
in the mongoDB entry doesn't contain strings which I print to stdout withprint
Minimal snippet to reproduce:
After running 5 times:
May be related with #101.