Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clusterresolver: remove priority LB related tests #6395

Merged
merged 3 commits into from
Jun 23, 2023

Conversation

easwars
Copy link
Contributor

@easwars easwars commented Jun 23, 2023

These scenarios are all covered in the priority LB policy, and it does not make sense for these tests to be part of the clusterresolver LB policy. Most likely, these tests got left behind when we refactored our LB policies.

#resource-agnostic-xdsclient-api

RELEASE NOTES: none

@easwars easwars requested a review from zasweq June 23, 2023 16:04
@easwars easwars added this to the 1.57 Release milestone Jun 23, 2023
Copy link
Contributor

@zasweq zasweq left a comment

Choose a reason for hiding this comment

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

LGTM.

case <-time.After(defaultTestShortTimeout):
}

select {
Copy link
Contributor

Choose a reason for hiding this comment

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

This line and below isn't captured in priority_test TestPriority_HighPriorityReady. Can you please copy paste this over there?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a couple of lines in there to check that p0 subConns are still in use, as long as p0 is ready.

//
// Init 0 and 1; 0 is up, use 0; 0 is down, 1 is up, use 1; add 2, use 1; 1 is
// down, use 2; remove 2, use 1.
func (s) TestEDSPriority_SwitchPriority(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I know all these tests are a bit clunky, but can you make sure that all the tests deleted don't delete extra operations/assertions that are captured in /xds/internal/balancer/priority/balancer_test.go.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From my reading of it, it does look like the tests in the priority package cover all scenarios. We definitely will have to rewrite them as e2e style tests. But I'm not planning to hike up that mountain until it becomes a necessity :).

One small hill at a time.

clab1 := xdstestutils.NewClusterLoadAssignmentBuilder(testClusterNames[0], nil)
clab1.AddLocality(testSubZones[0], 1, 0, testEndpointAddrs[:1], nil)
clab1.AddLocality(testSubZones[1], 1, 1, testEndpointAddrs[1:2], nil)
xdsC.InvokeWatchEDSCallback("", parseEDSRespProtoForTesting(clab1.Build()), nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting. This test does it through client and lets this balancer build out priority configuration from EDS. Priority_Test just inlines an UpdateClientConnState() with what this balancer would've built out. Yeah, makes more sense to have these tests over there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, we have tests in this package which verify that we build the appropriate priority LB configuration based on received updates. These are unit tests for now, could be changed to an e2e style test with the update coming through the xdsClient, but what we have is good enough for now I think.

@zasweq zasweq assigned easwars and unassigned zasweq Jun 23, 2023
@easwars easwars merged commit 0b3a81e into grpc:master Jun 23, 2023
1 check passed
@easwars easwars deleted the clusterresolver_test_cleanup_part_5 branch June 23, 2023 20:40
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants