Attempt to debug & fix TestReconnectBufferedUNIX for real #421
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR hopefully 💯% fixes the TestReconnectBufferedUNIX for good. Double non-determinism in
select
default branches means we have to loop for the outer as well as the inner result.What happened was: Flushing a TraceBackend happens in two steps:
FlushAsync
kicks off the flush in the background. If the goroutine is busy/not reading from the chan, this can returnErrWouldBlock
. We handled this case!ErrWouldBlock
if the backend is busy. We didn't handle this case!The part of the test that this was in was expecting a "real" error (not ErrWouldBlock) from the flush, and so in the relatively rare cases that ErrWouldBlock was returned, it would not have kicked off the flush and the later parts of the test would fail. Now, we handle both cases, so the test should correctly be in the right state always.
Motivation
This broke travis ci builds a bunch.
Test plan
Ran Travis CI tests a bunch
Rollout/monitoring/revert plan
Just merge, no changelog necessary.