-
Notifications
You must be signed in to change notification settings - Fork 4.5k
cleanup: replace dial with newclient #8196
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
base: master
Are you sure you want to change the base?
cleanup: replace dial with newclient #8196
Conversation
Is this PR ready for review? |
yes, please |
6458128
to
d672f29
Compare
This reverts commit 79f6f35.
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.
There are a lot of unnecessary log message changes added in this PR. This makes it really hard to spot and review actual code changes.
t.Fatalf("Failed to create new client: %v", 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.
Please revert.
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.
These log messages are suggested by Easwar's in other PR. Please see the discussion using the below links.
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 as all the changes are only in error messages.
@@ -166,7 +165,7 @@ func (s) TestEndpointShardingBasic(t *testing.T) { | |||
} | |||
cc, err := grpc.NewClient(mr.Scheme()+":///", dOpts...) | |||
if err != nil { | |||
log.Fatalf("Failed to create new client: %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.
Please only change log
to t
, the error message is fine.
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 changes in this file as they are only error message changes.
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 changes in this file as they are only error message changes.
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.
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.
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.
@@ -308,7 +308,7 @@ func (s) TestCZTopChannelRegistrationAndDeletionWhenDialFail(t *testing.T) { | |||
// Make dial fails (due to no transport security specified) | |||
_, err := grpc.NewClient("fake.addr") | |||
if err == nil { | |||
t.Fatal("expecting dial to fail") | |||
t.Fatalf("grpc.NewClient() failed: %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.
The message being replaced was the opposite, please fix.
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.
@@ -274,7 +274,6 @@ func (te *test) clientConn() *grpc.ClientConn { | |||
} | |||
opts := []grpc.DialOption{ | |||
grpc.WithTransportCredentials(insecure.NewCredentials()), | |||
grpc.WithBlock(), |
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.
If you are removing WithBlock
, you need to ensure the clientconn is ready before the function returns it. I ssupect this is the reason for the race conditions that you're seeing. Please use cc.Connect and testutils.AwaitState
here to restore the behviour.
func checkPickerUpdated(t *testing.T, d *gotData, e *expectedData) { | ||
var ( | ||
ok bool | ||
st *stats.PickerUpdated | ||
) | ||
if st, ok = d.s.(*stats.PickerUpdated); !ok { | ||
t.Fatalf("got %T, want PickerUpdated", d.s) | ||
} | ||
if d.ctx == nil { | ||
t.Fatalf("d.ctx = nil, want <non-nil>") | ||
} | ||
st.IsClient() // TODO remove this. | ||
} |
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 any assertion changes, we don't want to change the test logic.
addresses: #7049
RELEASE NOTES: None