From ceb12042f328571a99321decd2174a4f94943cc3 Mon Sep 17 00:00:00 2001 From: Vissa Janardhan Krishna Sai Date: Thu, 26 Dec 2024 12:10:06 +0000 Subject: [PATCH] updating error mdg --- test/clientconn_state_transition_test.go | 2 +- test/xds/xds_client_federation_test.go | 7 ++++--- test/xds/xds_security_config_nack_test.go | 2 +- test/xds/xds_server_rbac_test.go | 6 +++--- xds/internal/balancer/cdsbalancer/cdsbalancer_test.go | 6 +++--- .../balancer/clusterresolver/e2e_test/balancer_test.go | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/test/clientconn_state_transition_test.go b/test/clientconn_state_transition_test.go index d7617466401d..84957d5d96c9 100644 --- a/test/clientconn_state_transition_test.go +++ b/test/clientconn_state_transition_test.go @@ -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 diff --git a/test/xds/xds_client_federation_test.go b/test/xds/xds_client_federation_test.go index f94f2c182f44..382bdf97f9be 100644 --- a/test/xds/xds_client_federation_test.go +++ b/test/xds/xds_client_federation_test.go @@ -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 @@ -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 diff --git a/test/xds/xds_security_config_nack_test.go b/test/xds/xds_security_config_nack_test.go index 574574601aa8..8ef26b92860e 100644 --- a/test/xds/xds_security_config_nack_test.go +++ b/test/xds/xds_security_config_nack_test.go @@ -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() diff --git a/test/xds/xds_server_rbac_test.go b/test/xds/xds_server_rbac_test.go index a38f66e9643d..af5cfba0b486 100644 --- a/test/xds/xds_server_rbac_test.go +++ b/test/xds/xds_server_rbac_test.go @@ -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() @@ -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() @@ -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() diff --git a/xds/internal/balancer/cdsbalancer/cdsbalancer_test.go b/xds/internal/balancer/cdsbalancer/cdsbalancer_test.go index 84fb9e622d3f..0a20c3ba1e4b 100644 --- a/xds/internal/balancer/cdsbalancer/cdsbalancer_test.go +++ b/xds/internal/balancer/cdsbalancer/cdsbalancer_test.go @@ -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() }) @@ -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() }) @@ -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() }) diff --git a/xds/internal/balancer/clusterresolver/e2e_test/balancer_test.go b/xds/internal/balancer/clusterresolver/e2e_test/balancer_test.go index 77b73927159c..bab624c7bdec 100644 --- a/xds/internal/balancer/clusterresolver/e2e_test/balancer_test.go +++ b/xds/internal/balancer/clusterresolver/e2e_test/balancer_test.go @@ -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() {