rls: fix flaky test introduced by #6514 #6535
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.
#6514 changed some tests to use the
stub
balancer package instead of defining custom test balancers, but it introduced a bug which made one of the tests flaky.The bug was that a
testCCWrapper
was being passed as thebalancer.ClientConn
for the child policies of RLS. This meant that any state change reported by the child policy ended up changing the state of the main channel. This is not how it is supposed to work. The way it works is that the RLS LB policy intercepts state updates from the child policies, aggregates them and pushes a final state to the parent ClientConn.The fix for this PR ensures that the
balancer.ClientConn
passed by RLS LB policy (when it creates a child policy) is the one which gets passed to the child policy in the test as well.RELEASE NOTES: none