Commit
d9068d1a24b33b4837cdb7ba3d62aeebe26c3bc8
by olivierFix flakiness of TSan tests using flushes and synchronization
Co-authored-by: Fabrice Buoro <fabbing@free.fr>
All logging output is moved to stderr, the same output where TSan dumps
its race reports. This is to help understanding what happens if the
output of this test ever changes.
Additionally, a second synchronizing barrier is added to some tests to
remove flakiness.
The existing barrier ensured that
1. there was a data race, by delaying the synchronizing `Domain.join`
until after both domains had accessed the shared mutable field; and
2. that these accesses always happened in the same order (write first or
read first).
The role of the new barrier is to enforce always the same order between
the TSan report and logging lines such as `"Leaving f"`. Not enforcing
that order was the source of flakiness in these tests.