Skip to content

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

janardhanvissa
Copy link
Contributor

addresses: #7049

RELEASE NOTES: None

@arjan-bal
Copy link
Contributor

Is this PR ready for review?

@janardhanvissa
Copy link
Contributor Author

Is this PR ready for review?

yes, please

@janardhanvissa janardhanvissa force-pushed the replacing-dial-to-newclient branch from 6458128 to d672f29 Compare April 23, 2025 07:21
Copy link
Contributor

@arjan-bal arjan-bal left a 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)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert.

Copy link
Contributor Author

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.

#7967 (comment)
#7967 (comment)

Copy link
Contributor

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)
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert.

Copy link
Contributor

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)
Copy link
Contributor

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.

Copy link
Contributor

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(),
Copy link
Contributor

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.

Comment on lines +789 to +801
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.
}
Copy link
Contributor

@arjan-bal arjan-bal Apr 28, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants