-
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
cleanup: replace dial with newclient #7967
base: master
Are you sure you want to change the base?
cleanup: replace dial with newclient #7967
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7967 +/- ##
==========================================
+ Coverage 82.29% 82.35% +0.06%
==========================================
Files 387 387
Lines 38967 38942 -25
==========================================
+ Hits 32066 32071 +5
+ Misses 5586 5563 -23
+ Partials 1315 1308 -7 |
Please don't use |
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.
LGTM, assigning a second reviewer.
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.
Please revert this file, none of the changes are related to DIal to NewClient migration.
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
balancer_wrapper_test.go
Outdated
if err != nil { | ||
t.Fatal("Error dialing:", err) | ||
t.Fatal("Failed to create a client for server:", err) |
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.
This doesn't seem to be a very useful test failure message. How about just saying t.Fatal("NewClient() failed: %v", err)
. Here and elsewhere in this PR. Thanks.
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.
And wherever possible, include the target URI passed to NewClient
in the error message.
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
test/gracefulstop_test.go
Outdated
if err != nil { | ||
t.Fatalf("grpc.DialContext(_, %q, _) = %v", lis.Addr().String(), err) | ||
t.Fatalf("grpc.NewClient(_, %q, _) = %v", lis.Addr().String(), err) |
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.
This should be:
t.Fatalf("grpc.NewClient(%q) = %v", lis.Addr().String(), err)
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
|
||
_, err = testgrpc.NewTestServiceClient(cc1).FullDuplexCall(ctx) | ||
if err == nil || status.Code(err) != codes.Unavailable { | ||
t.Fatalf("Expected FullDuplexCall to fail with status code Unavailable, got: %v", err) |
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.
Git before want in error strings please. See: go/go-style/decisions#got-before-want
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
@@ -817,7 +817,7 @@ func (s) TestAggregatedCluster_CycleWithNoLeafNode(t *testing.T) { | |||
func (s) TestAggregatedCluster_CycleWithLeafNode(t *testing.T) { | |||
lbCfgCh, _, _, _ := registerWrappedClusterResolverPolicy(t) | |||
mgmtServer, nodeID, cc, _, _, _, _ := setupWithManagementServer(t) | |||
|
|||
cc.Connect() |
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.
Do we really need to call Connect
here? Can this be moved inside the helper function setupWithManagementServer
?
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
@@ -393,7 +393,7 @@ func (s) TestSecurityConfigNotFoundInBootstrap(t *testing.T) { | |||
|
|||
// Create a grpc channel with xDS creds. | |||
cc, _ := setupForSecurityTests(t, bootstrapContents, xdsClientCredsWithInsecureFallback(t), nil) | |||
|
|||
cc.Connect() |
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.
Same here. Do we need the call to Connect
? Aren't we doing an RPC later on? Can/Should we move this to be inside the helper?
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
_, _, _, r, xdsClient, cdsResourceRequestedCh, _ := setupWithManagementServer(t) | ||
|
||
_, _, cc, r, xdsClient, cdsResourceRequestedCh, _ := setupWithManagementServer(t) | ||
cc.Connect() |
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.
Same comment as above regarding the call to Connect
.
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
@@ -250,7 +251,7 @@ func (s) TestErrorFromParentLB_ResourceNotFound(t *testing.T) { | |||
// resolver, and dial the test backends. | |||
cc, cleanup := setupAndDial(t, bootstrapContents) | |||
defer cleanup() | |||
|
|||
cc.Connect() |
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.
Same comment about Connect for tests in this file too.
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
All the above comments are addressed. Please re-review once, |
Partially address: #7049
RELEASE NOTES: None