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

cleanup: replace dial with newclient #7967

Merged
merged 71 commits into from
Feb 28, 2025
Merged
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
7ddbe46
replace dial with newclient
janardhankrishna-sai Dec 23, 2024
71dacb1
replace dial with newclient
janardhankrishna-sai Dec 25, 2024
88c3f0f
updating error msg and replacing dial with newclient
janardhankrishna-sai Dec 26, 2024
ceb1204
updating error mdg
janardhankrishna-sai Dec 26, 2024
6be3cf0
revert TestFederation_UnknownAuthorityInDialTarget
janardhankrishna-sai Dec 26, 2024
f6cb17c
updating fatal msg
janardhankrishna-sai Dec 27, 2024
9f02ddd
replace dial with newclient
janardhankrishna-sai Dec 30, 2024
7fa6e5e
updating error msg
janardhankrishna-sai Dec 30, 2024
0486355
Merge branch 'master' of https://github.com/janardhanvissa/grpc-go
janardhankrishna-sai Jan 1, 2025
aec4527
updating error msg
janardhankrishna-sai Jan 1, 2025
8ea1edd
updating test
janardhankrishna-sai Jan 1, 2025
c7e8c3e
updating fatal msg
janardhankrishna-sai Jan 1, 2025
baec474
updating newclient target
janardhankrishna-sai Jan 5, 2025
36deff4
updating newclient target
janardhankrishna-sai Jan 5, 2025
c58db07
updating fatal msg
janardhankrishna-sai Jan 5, 2025
973d28a
updating fatal msg
janardhankrishna-sai Jan 5, 2025
c07189f
updating fatal msg
janardhankrishna-sai Jan 5, 2025
1fc9c6b
error msg updating
janardhankrishna-sai Jan 7, 2025
d520f73
updating fatal msg
janardhankrishna-sai Jan 7, 2025
53fa9cd
Merge branch 'grpc:master' into master
janardhanvissa Jan 8, 2025
506fd98
updating newclient err msg
janardhankrishna-sai Jan 9, 2025
f1ec518
Revert "updating newclient err msg"
janardhankrishna-sai Jan 9, 2025
fd2860b
Revert "Merge branch 'master' of https://github.com/janardhanvissa/gr…
janardhankrishna-sai Jan 9, 2025
56c4730
Reapply "Merge branch 'master' of https://github.com/janardhanvissa/g…
janardhankrishna-sai Jan 9, 2025
5c6eb74
Reapply "updating newclient err msg"
janardhankrishna-sai Jan 9, 2025
bf780fe
Revert "updating newclient err msg"
janardhankrishna-sai Jan 9, 2025
74ea67a
Reapply "Merge branch 'master' of https://github.com/janardhanvissa/g…
janardhankrishna-sai Jan 9, 2025
e7e95ce
Reapply "updating newclient err msg"
janardhankrishna-sai Jan 9, 2025
e24f0a5
addressing review comments and reapply reverted changes
janardhankrishna-sai Jan 12, 2025
aa049d9
addressing review comments and reapply reverted changes
janardhankrishna-sai Jan 12, 2025
4435b8a
Merge branch 'grpc:master' into master
janardhanvissa Jan 13, 2025
6c69f73
Merge branch 'master' of https://github.com/janardhanvissa/grpc-go in…
janardhankrishna-sai Jan 13, 2025
986e4e0
adding comment
janardhankrishna-sai Jan 21, 2025
12936a7
removing explicit client connection on setupAndDial
janardhankrishna-sai Jan 21, 2025
aa1434b
updating explicit client connection
janardhankrishna-sai Jan 21, 2025
0db5faa
updating explicit client connection
janardhankrishna-sai Jan 21, 2025
dad978a
updating explicit client connection
janardhankrishna-sai Jan 21, 2025
894eee7
replace dial with newclient
janardhankrishna-sai Jan 22, 2025
8b8496e
updating fatal msg
janardhankrishna-sai Jan 22, 2025
b6f32f3
reverting test update
janardhankrishna-sai Jan 22, 2025
658b745
reverting test update
janardhankrishna-sai Jan 22, 2025
f1102b3
Revert "reverting test update"
janardhankrishna-sai Jan 23, 2025
6a83587
replace dial with newclient
janardhankrishna-sai Jan 23, 2025
81c4724
renaming test from dial to newclient
janardhankrishna-sai Jan 23, 2025
a6630a7
updating resolver state
janardhankrishna-sai Jan 23, 2025
54fc7e8
replace dial with newclient
janardhankrishna-sai Jan 24, 2025
ba3a12c
Merge branch 'replace-dial-with-newclient' of https://github.com/jana…
janardhankrishna-sai Jan 24, 2025
0c6c9e2
removing empty line
janardhankrishna-sai Jan 24, 2025
e253082
updating newclient target
janardhankrishna-sai Jan 24, 2025
e373c09
addressing review comments
janardhankrishna-sai Feb 13, 2025
0e30408
reverting merge conflict file
janardhankrishna-sai Feb 13, 2025
7951441
explicit cc.Connect() call
janardhankrishna-sai Feb 13, 2025
99da62a
adding dummy rpc call to force connection
janardhankrishna-sai Feb 13, 2025
782a8dc
replace dialContext with newclient
janardhankrishna-sai Feb 14, 2025
d887717
Revert "adding dummy rpc call to force connection"
janardhankrishna-sai Feb 14, 2025
f2810ff
revert TestGracefulStop changes due to conflict
janardhankrishna-sai Feb 14, 2025
24a9eae
addressing review comments
janardhankrishna-sai Feb 15, 2025
56a387c
replace dialcontext with newclient
janardhankrishna-sai Feb 17, 2025
05be920
Merge branch 'master' into replace-dial-with-newclient
janardhanvissa Feb 17, 2025
fdf8a11
Update comments
janardhanvissa Feb 17, 2025
80d499f
Update comment
janardhanvissa Feb 17, 2025
2358d64
addressing review comments
janardhankrishna-sai Feb 18, 2025
57fe1bc
revert fatal msg
janardhankrishna-sai Feb 20, 2025
9dc0cfd
updating error msg and moving cc.Connect() inside helper func
janardhankrishna-sai Feb 20, 2025
7837056
removing explicit cc.Connect() call
janardhankrishna-sai Feb 21, 2025
5662c89
addressing review comments
janardhankrishna-sai Feb 25, 2025
6c41a7e
updating fatal msg
janardhankrishna-sai Feb 25, 2025
e813c71
updating fatal msg
janardhankrishna-sai Feb 25, 2025
093e7e4
updating error msg from NewClient() to grpc.NewClient()
janardhankrishna-sai Feb 27, 2025
cfcb91f
updating error msg from NewClient() to grpc.NewClient()
janardhankrishna-sai Feb 27, 2025
b55f656
updating error msg
janardhankrishna-sai Feb 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
addressing review comments
janardhankrishna-sai committed Feb 18, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 2358d64c4eb1f7672f1a862e7d600097afc4a745
15 changes: 8 additions & 7 deletions clientconn_test.go
Original file line number Diff line number Diff line change
@@ -385,7 +385,7 @@ func (s) TestBackoffWhenNoServerPrefaceReceived(t *testing.T) {
}
cc, err := NewClient(lis.Addr().String(), WithTransportCredentials(insecure.NewCredentials()), WithConnectParams(cp))
if err != nil {
t.Fatalf("Unexpected error from NewClient(%v) = %v", lis.Addr(), err)
t.Fatalf("Failed to create a client for server: %v", err)
}
defer cc.Close()
go stayConnected(cc)
@@ -624,7 +624,7 @@ func testBackoffConfigSet(t *testing.T, wantBackoff internalbackoff.Exponential,
opts = append(opts, WithTransportCredentials(insecure.NewCredentials()))
conn, err := NewClient("passthrough:///foo:80", opts...)
if err != nil {
t.Fatalf("unexpected error newclient connection: %v", err)
t.Fatalf("Failed to create a client for server: %v", err)
}
defer conn.Close()

@@ -813,6 +813,7 @@ func (s) TestMethodConfigDefaultService(t *testing.T) {
}
cc.Connect()
defer cc.Close()

m := cc.GetMethodConfig("/foo/Bar")
if m.WaitForReady == nil {
t.Fatalf("want: method (%q) config to fallback to the default service", "/foo/Bar")
@@ -888,12 +889,12 @@ func (s) TestResetConnectBackoff(t *testing.T) {
select {
case <-dials:
case <-time.NewTimer(10 * time.Second).C:
t.Fatal("Failed to call NewClient within 10s")
t.Fatal("Failed to call dial within 10s")
}

select {
case <-dials:
t.Fatal("NewClient called unexpectedly before resetting backoff")
t.Fatal("Dial called unexpectedly before resetting backoff")
case <-time.NewTimer(100 * time.Millisecond).C:
}

@@ -902,18 +903,18 @@ func (s) TestResetConnectBackoff(t *testing.T) {
select {
case <-dials:
case <-time.NewTimer(10 * time.Second).C:
t.Fatal("Failed to call NewClient within 10s after resetting backoff")
t.Fatal("Failed to call dial within 10s after resetting backoff")
}
}

func (s) TestBackoffCancel(t *testing.T) {
dialStrCh := make(chan string)
cc, err := NewClient("passthrough:///", WithTransportCredentials(insecure.NewCredentials()), WithDialer(func(t string, _ time.Duration) (net.Conn, error) {
dialStrCh <- t
return nil, fmt.Errorf("Failed to create a client")
return nil, fmt.Errorf("test dialer, always error")
}))
if err != nil {
t.Fatalf("Failed to create ClientConn: %v", err)
t.Fatalf("Failed to create a client for server: %v", err)
}
cc.Connect()
defer cc.Close()
4 changes: 2 additions & 2 deletions test/gracefulstop_test.go
Original file line number Diff line number Diff line change
@@ -138,8 +138,6 @@ func (s) TestGracefulStop(t *testing.T) {

<-dlis.closeCalled // Block until GracefulStop calls dlis.Close()

// Attempt to dial the server using a custom dialer. Since the listener is
// already closed, no new connections should be established.
dialer := func(ctx context.Context, _ string) (net.Conn, error) { return dlis.Dial(ctx) }
cc, err := grpc.NewClient("passthrough:///", grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithContextDialer(dialer))
if err != nil {
@@ -151,6 +149,8 @@ func (s) TestGracefulStop(t *testing.T) {
// 4. Make an RPC.
// The server would send a GOAWAY first, but we are delaying the server's
// writes for now until the client writes more than the preface.
// This will cause a connection to be accepted. This will
// also unblock the Close method.
ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
if _, err = client.FullDuplexCall(ctx); err == nil || status.Code(err) != codes.Unavailable {
t.Fatalf("FullDuplexCall= _, %v; want _, <status code Unavailable>", err)
Original file line number Diff line number Diff line change
@@ -536,7 +536,6 @@ func (s) TestSecurityConfigUpdate_BadToGood(t *testing.T) {
// Create a grpc channel with xDS creds talking to a test server with TLS
// credentials.
cc, serverAddress := setupForSecurityTests(t, bc, xdsClientCredsWithInsecureFallback(t), tlsServerCreds(t))
defer cc.Close()
cc.Connect()
// Configure cluster and endpoints resources in the management server. The
// cluster resource contains security configuration with a certificate