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 #7975

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
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.NewClient("",
client, err := grpc.NewClient("passthrough:///",
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"loadBalancingConfig": [{"%s":{}}]}`, stateRecordingBalancerName)),
grpc.WithDialer(pl.Dialer()),
arjan-bal marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
2 changes: 1 addition & 1 deletion 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.NewClient(lisAddr, grpc.WithTransportCredentials(local.NewCredentials()))
cc, err = grpc.NewClient("passthrough:///"+lisAddr, grpc.WithTransportCredentials(local.NewCredentials()))
arjan-bal marked this conversation as resolved.
Show resolved Hide resolved
case "tcp":
cc, err = grpc.NewClient(lisAddr, grpc.WithTransportCredentials(local.NewCredentials()))
default:
Expand Down
14 changes: 10 additions & 4 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.NewClient(target, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithResolvers(xdsResolver))
if err == nil || !strings.Contains(err.Error(), wantErr) {
t.Fatalf("grpc.NewClient(%q) returned %v, want: %s", target, err, wantErr)
cc, err = grpc.NewClient(target, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithResolvers(xdsResolver))
arjan-bal marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
t.Logf("Expected error while creating ClientConn: %v", err)
arjan-bal marked this conversation as resolved.
Show resolved Hide resolved
} else {
client := testgrpc.NewTestServiceClient(cc)
_, err := client.EmptyCall(ctx, &testpb.Empty{})
if err == nil || !strings.Contains(err.Error(), wantErr) {
t.Fatalf("Expected error containing %q, got: %v", wantErr, err)
}
}
arjan-bal marked this conversation as resolved.
Show resolved Hide resolved
}

Expand Down
Loading