I'm seeing something strange when I run a cc_test target using `bazel run`. The program logs a bunch of messages to stderr. If I do the run repeatedly in quick succession every now and then the messages stop midstream, then no more output. But I check the output (it writes some files) and it seems ok.
I've added fflush(NULL) in many places in the code and it does not seem to help.
I'm guessing this has something to do with how Bazel manages stderr/stdout when it runs programs. The best theory I can think of is that since the Bazel server is running programs, and presumably it is multithreaded, when I rerun my program immediately, the prior run has not yet been unloaded, so to speak, and then stderr/stdout buffering gets screwed up. But that's a wild guess.
Any suggestions?