Skip to content

Commit

Permalink
updating error mdg
Browse files Browse the repository at this point in the history
  • Loading branch information
janardhankrishna-sai committed Dec 26, 2024
1 parent 88c3f0f commit ceb1204
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion test/clientconn_state_transition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ func (s) TestConnectivityStateSubscriber(t *testing.T) {
grpc.WithTransportCredentials(insecure.NewCredentials()),
)
if err != nil {
t.Fatalf("NewClient() failed: %v", err)
t.Fatalf("failed to create a client for server: %v", err)
}
cc.Connect()
// Subscribe to state updates. Use a buffer size of 1 to allow the
Expand Down
7 changes: 4 additions & 3 deletions test/xds/xds_client_federation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func (s) TestClientSideFederationWithOnlyXDSTPStyleLDS(t *testing.T) {
// is created with a dial target containing an authority which is not specified
// in the bootstrap configuration. The test verifies that RPCs on the ClientConn
// fail with an appropriate error.
func (s) TestFederation_UnknownAuthorityInDialTarget(t *testing.T) {
func TestFederation_UnknownAuthorityInDialTarget(t *testing.T) {
// Setting up the management server is not *really* required for this test
// case. All we need is a bootstrap configuration which does not contain the
// authority mentioned in the dial target. But setting up the management
Expand Down Expand Up @@ -288,10 +288,11 @@ func (s) TestFederation_UnknownAuthorityInDialTarget(t *testing.T) {
target = fmt.Sprintf("xds://unknown-authority/%s", serviceName)
t.Logf("Dialing target %q with unknown authority which is expected to fail", 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 || !strings.Contains(err.Error(), wantErr) {
t.Fatalf("grpc.Dial(%q) returned %v, want: %s", target, err, wantErr)
t.Fatalf("grpc.NewClient(%q) returned %v, want: %s", target, err, wantErr)
}
defer cc.Close()
}

// TestFederation_UnknownAuthorityInReceivedResponse tests the case where the
Expand Down
2 changes: 1 addition & 1 deletion test/xds/xds_security_config_nack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (s) TestUnmarshalListener_WithUpdateValidatorFunc(t *testing.T) {
// Create a ClientConn with the xds scheme and make an RPC.
cc, err := grpc.NewClient(fmt.Sprintf("xds:///%s", serviceName), grpc.WithTransportCredentials(creds), grpc.WithResolvers(xdsResolver))
if err != nil {
t.Fatalf("NewClient() failed: %v", err)
t.Fatalf("failed to create a client for server: %v", err)
}
defer cc.Close()

Expand Down
6 changes: 3 additions & 3 deletions test/xds/xds_server_rbac_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func (s) TestServerSideXDS_RouteConfiguration(t *testing.T) {

cc, err := grpc.NewClient(fmt.Sprintf("xds:///%s", serviceName), grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithResolvers(xdsResolver))
if err != nil {
t.Fatalf("NewClient() failed: %v", err)
t.Fatalf("failed to create a client for server: %v", err)
}
defer cc.Close()

Expand Down Expand Up @@ -656,7 +656,7 @@ func (s) TestRBACHTTPFilter(t *testing.T) {

cc, err := grpc.NewClient(fmt.Sprintf("xds:///%s", serviceName), grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithResolvers(xdsResolver))
if err != nil {
t.Fatalf("NewClient() failed: %v", err)
t.Fatalf("failed to create a client for server: %v", err)
}
defer cc.Close()

Expand Down Expand Up @@ -838,7 +838,7 @@ func (s) TestRBACToggledOn_WithBadRouteConfiguration(t *testing.T) {

cc, err := grpc.NewClient(fmt.Sprintf("xds:///%s", serviceName), grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithResolvers(xdsResolver))
if err != nil {
t.Fatalf("NewClient() failed: %v", err)
t.Fatalf("failed to create a client for server: %v", err)
}
defer cc.Close()

Expand Down
6 changes: 3 additions & 3 deletions xds/internal/balancer/cdsbalancer/cdsbalancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ func setupWithManagementServerAndListener(t *testing.T, lis net.Listener) (*e2e.

cc, err := grpc.NewClient(r.Scheme()+":///test.service", grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithResolvers(r))
if err != nil {
t.Fatalf("NewClient() failed: %v", err)
t.Fatalf("failed to create a client for server: %v", err)
}
cc.Connect()
t.Cleanup(func() { cc.Close() })
Expand Down Expand Up @@ -395,7 +395,7 @@ func (s) TestConfigurationUpdate_EmptyCluster(t *testing.T) {
// Create a ClientConn with the above manual resolver.
cc, err := grpc.NewClient(r.Scheme()+":///test.service", grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithResolvers(r))
if err != nil {
t.Fatalf("NewClient() failed: %v", err)
t.Fatalf("failed to create a client for server: %v", err)
}
cc.Connect()
t.Cleanup(func() { cc.Close() })
Expand Down Expand Up @@ -433,7 +433,7 @@ func (s) TestConfigurationUpdate_MissingXdsClient(t *testing.T) {
// Create a ClientConn with the above manual resolver.
cc, err := grpc.NewClient(r.Scheme()+":///test.service", grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithResolvers(r))
if err != nil {
t.Fatalf("NewClient() failed: %v", err)
t.Fatalf("failed to create a client for server: %v", err)
}
cc.Connect()
t.Cleanup(func() { cc.Close() })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func setupAndDial(t *testing.T, bootstrapContents []byte) (*grpc.ClientConn, fun
cc, err := grpc.NewClient(r.Scheme()+":///test.service", grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithResolvers(r))
if err != nil {
xdsClose()
t.Fatalf("NewClient() failed: %v", err)
t.Fatalf("failed to create a client for server: %v", err)
}
cc.Connect()
return cc, func() {
Expand Down

0 comments on commit ceb1204

Please sign in to comment.