-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
cdsbalancer: test cleanup part 1/N #6546
Conversation
4401e12
to
9b6c48f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments.
Thanks for the review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look great. Thanks for addressing all my comments. LGTM!
// Tests a single success scenario where the cds LB policy receives a cluster | ||
// resource from the management server with LRS enabled. Verifies that the load | ||
// balancing configuration pushed to the child is as expected. | ||
func (s) TestClusterUpdate_SuccessWithLRS(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure there's a reason, but why is this not merged in with the t test directly above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to merge them but it made the other test way more complicated than it had to. The reason is that the lrs config in the resource from the management server simply has a config source which says "self". But this has to be translated into the server config from the bootstrap. This means that the server URI (in the wantConfig) has to depend on the actual address of the management server. This means that I can't statically define wantConfig in the test table in the previous test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm ok. I think you could argue you could have a conditional and write an extra field to the static configuration. I.e. if test name {test.wantChildConfig.DiscoveryMechanism.LoardReportingServer = want}. But this isn't too many lines of code so seems fine :).
t.Fatalf("EmptyCall() failed: %v", err) | ||
} | ||
|
||
// Retrieve the cds LB policy policy and call ExitIdle() on it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more policy policy :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
This PR is the first in a set of test cleanups for the tests in the cds balancer. This is a pre-requisite for switching the cds balancer to use the generic xdsClient watch API.
Summary of changes:
cdsbalancer_test.go
to use a real management server and rely on behavior instead of internal implementation detailse2e
packageCluster
resource to use the utilities provided by thee2e
packageUpdateStateCallback
to themanual
resolverRELEASE NOTES: none