Repository navigation
grpc/load_balancing: New tests for pick_first - #3014
Open
nathanielford wants to merge 7 commits into
Open
nathanielford wants to merge 7 commits into
nathanielford wants to merge 7 commits into
Conversation
# Conflicts: # grpc/src/client/load_balancing/pick_first.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
pick_firsthas a number of intended behaviors around first pass behavior that are not tested.TRANSIENT_FAILURE, it should count it as failing without retrying.READY, it is selected immediately w/o asking any other subchannel to connect.IDLE. The pass won't end until that attempt fails.These behaviors are all implemented but are not fully covered by tests.
Solution
The following was done:
test_pick_first_empty_update_clears_stateassertions to cover ignoring updates from old subchannels and add an address that is Ready, to prove the old selection is cleared.test_pick_first_pass_ends_when_every_attempt_in_it_failsto test that the first pass only ends when every address has failed during the pass. This subsumestest_pick_first_happy_eyeballs_out_of_order_failure, so we remove it.test_pick_first_new_subchannel_initially_readyto cover a subchannel that is ready when created is selected immediately.test_pick_first_new_subchannel_initially_transient_failureto ensure a subchannel in TF counts as failed and is skipped.test_pick_first_steady_state_retriesbecause it's covered bytest_pick_first_steady_state_multi_backend.