Fix the flaky LingeringRoundRobinLoadBalancerTest #2732
Merged
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.
Motivation:
The test
expiringAHostDoesntRaceWithConnectionAdding
is flaky but only in CI.This is because locally we essentially never hit the
else
branch where theconnection was added first but it does happen in CI. The
else
branch of thetest is flawed: the host is marked as
EXPIRED
and thus unhealthy, so we shouldalways expect a
NoActiveHostException
instead of aNoAvailableHostException
.Modifications:
Change the expected exception to NoActiveHostException.
Result:
Less flakiness.
Closes #2677.
Testing
The
else
branch can be tested locally by waiting for the futuref
to completebefore sending the service discovery event, eg adding a
f.get()
right afterthe assignment of
f
.