Skip to content

cleanup: replace dial with newclient #7975

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

Merged
merged 28 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7d2a53b
replace dial with newclient
janardhankrishna-sai Dec 31, 2024
66a6a32
passing passthrough to the newclient and updating err msg
janardhankrishna-sai Dec 31, 2024
614299d
adding close() for goroutine leak and using fatal instead of log
janardhankrishna-sai Dec 31, 2024
beb8b0f
waiting for the test balancer to be built before getting the state no…
janardhankrishna-sai Dec 31, 2024
b405e43
replace dial with newclient and updating error msg
janardhankrishna-sai Dec 31, 2024
1748c69
reverting config whitespaces
janardhankrishna-sai Dec 31, 2024
be8a69f
reverting config whitespaces
janardhankrishna-sai Dec 31, 2024
fe19ecf
updating error msg
janardhankrishna-sai Dec 31, 2024
77953ec
updating error msg
janardhankrishna-sai Jan 1, 2025
3e1fc48
addressing review comments
janardhankrishna-sai Jan 2, 2025
09b067c
using r.InitialState instead of r.UpdateState
janardhankrishna-sai Jan 2, 2025
1fddf6b
defining load balancing grpclb service config
janardhankrishna-sai Jan 3, 2025
6f1e7c2
using load balancing service config
janardhankrishna-sai Jan 3, 2025
ab5f146
using internal.ParseServiceConfig to avoid depending on manual resolv…
janardhankrishna-sai Jan 6, 2025
3b75fe7
using const for timeout and lbpolicy, updating comments and removing …
janardhankrishna-sai Jan 20, 2025
14d0d7d
using const for grpclbpolicy
janardhankrishna-sai Jan 20, 2025
1835cfe
adding ctx in callandverify and removing explicit cc.Connect() call
janardhankrishna-sai Jan 21, 2025
c163e9f
removing check for len of resolver state address
janardhankrishna-sai Jan 21, 2025
d74e2de
updating resolver state and parseserviceconfig
janardhankrishna-sai Jan 24, 2025
f377c38
addressing review comments
janardhankrishna-sai Jan 27, 2025
ce24eb5
updating comment
janardhankrishna-sai Jan 28, 2025
54a2a01
removing duplicate comments
janardhankrishna-sai Jan 28, 2025
540911c
addressing review comments
janardhankrishna-sai Jan 28, 2025
59a45c7
using parseServiceConfig instead of internal.ParseServiceConfig
janardhankrishna-sai Feb 4, 2025
358cb39
using parseServiceConfig, explicitly calling cc.Connect() and updatin…
janardhankrishna-sai Feb 5, 2025
ba8385d
using parseServiceConfig, explicitly calling cc.Connect() and updatin…
janardhankrishna-sai Feb 5, 2025
42ada72
removing comment
janardhankrishna-sai Feb 5, 2025
9834f60
addressing review comments
janardhankrishna-sai Feb 17, 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
2 changes: 1 addition & 1 deletion test/clientconn_state_transition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func testStateTransitionSingleAddress(t *testing.T, want []connectivity.State, s
connMu.Unlock()
}()

client, err := grpc.Dial("",
client, err := grpc.NewClient("passthrough:///",
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"loadBalancingConfig": [{"%s":{}}]}`, stateRecordingBalancerName)),
grpc.WithDialer(pl.Dialer()),
Expand Down
4 changes: 2 additions & 2 deletions test/local_creds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func testLocalCredsE2ESucceed(network, address string) error {

switch network {
case "unix":
cc, err = grpc.Dial(lisAddr, grpc.WithTransportCredentials(local.NewCredentials()), grpc.WithContextDialer(
cc, err = grpc.NewClient("passthrough:///"+lisAddr, grpc.WithTransportCredentials(local.NewCredentials()), grpc.WithContextDialer(
func(_ context.Context, addr string) (net.Conn, error) {
return net.Dial("unix", addr)
}))
Expand All @@ -102,7 +102,7 @@ func testLocalCredsE2ESucceed(network, address string) error {
return fmt.Errorf("Failed to dial server: %v, %v", err, lisAddr)
}
defer cc.Close()

cc.Connect()
c := testgrpc.NewTestServiceClient(cc)
ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout)
defer cancel()
Expand Down
12 changes: 9 additions & 3 deletions test/xds/xds_client_federation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,17 @@ func (s) TestFederation_UnknownAuthorityInDialTarget(t *testing.T) {
t.Log("Successfully performed an EmptyCall RPC")

target = fmt.Sprintf("xds://unknown-authority/%s", serviceName)
t.Logf("Dialing target %q with unknown authority which is expected to fail", target)
t.Logf("Creating a channel with unknown authority %q, expecting failure", target)
wantErr := fmt.Sprintf("authority \"unknown-authority\" specified in dial target %q is not found in the bootstrap file", target)
_, err = grpc.Dial(target, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithResolvers(xdsResolver))
cc, err = grpc.NewClient(target, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithResolvers(xdsResolver))
if err != nil {
t.Fatalf("Expected error while creating ClientConn: %v", err)
}
defer cc.Close()
client = testgrpc.NewTestServiceClient(cc)
_, err = client.EmptyCall(ctx, &testpb.Empty{})
if err == nil || !strings.Contains(err.Error(), wantErr) {
t.Fatalf("grpc.Dial(%q) returned %v, want: %s", target, err, wantErr)
t.Fatalf("Expected error containing %q, got: %v", wantErr, err)
}
}

Expand Down
Loading