Skip to content

Conversation

@dfawley
Copy link
Collaborator

@dfawley dfawley commented Nov 18, 2025

This change is based heavily on #2405, especially the tests.

@dfawley dfawley added this to the grpc-next milestone Nov 18, 2025
//
// The state is determined according to normal state aggregation rules, and
// the picker round-robins between all children in that state.
fn resolve_child_updates(&mut self, channel_controller: &mut dyn ChannelController) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't particularly see it doing anything related to resolver? It is using resolve as an overloaded termm here? It seems closer to update_picker to me from the implementation.


impl TestSubchannelList {
fn new(addresses: &Vec<Address>, channel_controller: &mut dyn ChannelController) -> Self {
let mut scl = TestSubchannelList {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: more descriptive name like subchannel_list

}
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a lot of boilerplate before the tests even start ~400+ LOC. Is this expected? Will dependency injection and mocking childmanager and pick first help here?

Additionally, I am not sure if it applies here. But go/tott/643 somewhat recommends leaning heavily towards not overabstracting utility functions to keep things dry.

Comment on lines +864 to +871
assert!(
picked[0] != picked[1].clone(),
"Should alternate between subchannels"
);
assert_eq!(&picked[0], &picked[2]);
assert_eq!(&picked[1], &picked[3]);
assert!(picked.contains(&subchannels[0]));
assert!(picked.contains(&subchannels[1]));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is detereministic, so can we assert the entire container of pickers chosen?

for child_idx in 0..self.children.len() {
let child = &mut self.children[child_idx];
let mut channel_controller = WrappedController::new(channel_controller);
let _ = child.policy.resolver_update(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this variable?

@sauravzg
Copy link
Collaborator

Thanks for the amazing test descriptions. They were really amazing at smoothening the test reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants