diff --git a/test/healthcheck_test.go b/test/healthcheck_test.go index 74a140034dd2..42fdb4518e42 100644 --- a/test/healthcheck_test.go +++ b/test/healthcheck_test.go @@ -254,11 +254,11 @@ func (s) TestHealthCheckWatchStateChange(t *testing.T) { r.UpdateState(resolver.State{ Addresses: []resolver.Address{{Addr: lis.Addr().String()}}, ServiceConfig: parseServiceConfig(t, r, `{ - "healthCheckConfig": { - "serviceName": "foo" - }, - "loadBalancingConfig": [{"round_robin":{}}] - }`)}) + "healthCheckConfig": { + "serviceName": "foo" + }, + "loadBalancingConfig": [{"round_robin":{}}] +}`)}) ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer cancel() @@ -309,11 +309,11 @@ func (s) TestHealthCheckHealthServerNotRegistered(t *testing.T) { r.UpdateState(resolver.State{ Addresses: []resolver.Address{{Addr: lis.Addr().String()}}, ServiceConfig: parseServiceConfig(t, r, fmt.Sprintf(`{ - "healthCheckConfig": { - "serviceName": "foo" - }, - "loadBalancingConfig": [{"%s":{}}] - }`, healthCheckTestPolicyName))}) + "healthCheckConfig": { + "serviceName": "foo" + }, + "loadBalancingConfig": [{"%s":{}}] + }`, healthCheckTestPolicyName))}) ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer cancel() @@ -336,11 +336,11 @@ func (s) TestHealthCheckWithGoAway(t *testing.T) { r.UpdateState(resolver.State{ Addresses: []resolver.Address{{Addr: lis.Addr().String()}}, ServiceConfig: parseServiceConfig(t, r, fmt.Sprintf(`{ - "healthCheckConfig": { - "serviceName": "foo" - }, - "loadBalancingConfig": [{"%s":{}}] - }`, healthCheckTestPolicyName))}) + "healthCheckConfig": { + "serviceName": "foo" + }, + "loadBalancingConfig": [{"%s":{}}] + }`, healthCheckTestPolicyName))}) ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer cancel() @@ -414,11 +414,11 @@ func (s) TestHealthCheckWithConnClose(t *testing.T) { r.UpdateState(resolver.State{ Addresses: []resolver.Address{{Addr: lis.Addr().String()}}, ServiceConfig: parseServiceConfig(t, r, fmt.Sprintf(`{ - "healthCheckConfig": { - "serviceName": "foo" - }, - "loadBalancingConfig": [{"%s":{}}] - }`, healthCheckTestPolicyName))}) + "healthCheckConfig": { + "serviceName": "foo" + }, + "loadBalancingConfig": [{"%s":{}}] + }`, healthCheckTestPolicyName))}) ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer cancel() @@ -462,11 +462,11 @@ func (s) TestHealthCheckWithAddrConnDrain(t *testing.T) { cc, r := setupClient(t, &clientConfig{}) tc := testgrpc.NewTestServiceClient(cc) sc := parseServiceConfig(t, r, fmt.Sprintf(`{ - "healthCheckConfig": { - "serviceName": "foo" - }, - "loadBalancingConfig": [{"%s":{}}] - }`, healthCheckTestPolicyName)) + "healthCheckConfig": { + "serviceName": "foo" + }, + "loadBalancingConfig": [{"%s":{}}] + }`, healthCheckTestPolicyName)) r.UpdateState(resolver.State{ Addresses: []resolver.Address{{Addr: lis.Addr().String()}}, ServiceConfig: sc, @@ -544,11 +544,11 @@ func (s) TestHealthCheckWithClientConnClose(t *testing.T) { r.UpdateState(resolver.State{ Addresses: []resolver.Address{{Addr: lis.Addr().String()}}, ServiceConfig: parseServiceConfig(t, r, (fmt.Sprintf(`{ - "healthCheckConfig": { - "serviceName": "foo" - }, - "loadBalancingConfig": [{"%s":{}}] - }`, healthCheckTestPolicyName)))}) + "healthCheckConfig": { + "serviceName": "foo" + }, + "loadBalancingConfig": [{"%s":{}}] + }`, healthCheckTestPolicyName)))}) ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer cancel() @@ -611,11 +611,11 @@ func (s) TestHealthCheckWithoutSetConnectivityStateCalledAddrConnShutDown(t *tes // back to client immediately upon receiving the request (client should receive no response until // test ends). sc := parseServiceConfig(t, r, fmt.Sprintf(`{ - "healthCheckConfig": { - "serviceName": "delay" - }, - "loadBalancingConfig": [{"%s":{}}] - }`, healthCheckTestPolicyName)) + "healthCheckConfig": { + "serviceName": "delay" + }, + "loadBalancingConfig": [{"%s":{}}] + }`, healthCheckTestPolicyName)) r.UpdateState(resolver.State{ Addresses: []resolver.Address{{Addr: lis.Addr().String()}}, ServiceConfig: sc, @@ -676,11 +676,11 @@ func (s) TestHealthCheckWithoutSetConnectivityStateCalled(t *testing.T) { r.UpdateState(resolver.State{ Addresses: []resolver.Address{{Addr: lis.Addr().String()}}, ServiceConfig: parseServiceConfig(t, r, fmt.Sprintf(`{ - "healthCheckConfig": { - "serviceName": "delay" - }, - "loadBalancingConfig": [{"%s":{}}] - }`, healthCheckTestPolicyName))}) + "healthCheckConfig": { + "serviceName": "delay" + }, + "loadBalancingConfig": [{"%s":{}}] + }`, healthCheckTestPolicyName))}) select { case <-hcExitChan: @@ -714,11 +714,11 @@ func testHealthCheckDisableWithDialOption(t *testing.T, addr string) { r.UpdateState(resolver.State{ Addresses: []resolver.Address{{Addr: addr}}, ServiceConfig: parseServiceConfig(t, r, fmt.Sprintf(`{ - "healthCheckConfig": { - "serviceName": "foo" - }, - "loadBalancingConfig": [{"%s":{}}] - }`, healthCheckTestPolicyName))}) + "healthCheckConfig": { + "serviceName": "foo" + }, + "loadBalancingConfig": [{"%s":{}}] + }`, healthCheckTestPolicyName))}) ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer cancel() @@ -746,11 +746,11 @@ func testHealthCheckDisableWithBalancer(t *testing.T, addr string) { r.UpdateState(resolver.State{ Addresses: []resolver.Address{{Addr: addr}}, ServiceConfig: parseServiceConfig(t, r, `{ - "healthCheckConfig": { - "serviceName": "foo" - }, - "loadBalancingConfig": [{"pick_first":{}}] - }`)}) + "healthCheckConfig": { + "serviceName": "foo" + }, + "loadBalancingConfig": [{"pick_first":{}}] +}`)}) ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer cancel() @@ -820,11 +820,11 @@ func (s) TestHealthCheckChannelzCountingCallSuccess(t *testing.T) { r.UpdateState(resolver.State{ Addresses: []resolver.Address{{Addr: lis.Addr().String()}}, ServiceConfig: parseServiceConfig(t, r, fmt.Sprintf(`{ - "healthCheckConfig": { - "serviceName": "channelzSuccess" - }, - "loadBalancingConfig": [{"%s":{}}] - }`, healthCheckTestPolicyName))}) + "healthCheckConfig": { + "serviceName": "channelzSuccess" + }, + "loadBalancingConfig": [{"%s":{}}] + }`, healthCheckTestPolicyName))}) if err := verifyResultWithDelay(func() (bool, error) { cm, _ := channelz.GetTopChannels(0, 0) @@ -869,11 +869,11 @@ func (s) TestHealthCheckChannelzCountingCallFailure(t *testing.T) { r.UpdateState(resolver.State{ Addresses: []resolver.Address{{Addr: lis.Addr().String()}}, ServiceConfig: parseServiceConfig(t, r, fmt.Sprintf(`{ - "healthCheckConfig": { - "serviceName": "channelzFailure" - }, - "loadBalancingConfig": [{"%s":{}}] - }`, healthCheckTestPolicyName))}) + "healthCheckConfig": { + "serviceName": "channelzFailure" + }, + "loadBalancingConfig": [{"%s":{}}] + }`, healthCheckTestPolicyName))}) if err := verifyResultWithDelay(func() (bool, error) { cm, _ := channelz.GetTopChannels(0, 0) @@ -1251,11 +1251,11 @@ func (s) TestHealthCheckUnregisterHealthListener(t *testing.T) { _, r := setupClient(t, nil) svcCfg := fmt.Sprintf(`{ - "healthCheckConfig": { - "serviceName": "foo" - }, - "loadBalancingConfig": [{"%s":{}}] - }`, t.Name()) + "healthCheckConfig": { + "serviceName": "foo" + }, + "loadBalancingConfig": [{"%s":{}}] + }`, t.Name()) r.UpdateState(resolver.State{ Addresses: []resolver.Address{{Addr: lis.Addr().String()}}, ServiceConfig: parseServiceConfig(t, r, svcCfg)}) diff --git a/test/resolver_update_test.go b/test/resolver_update_test.go index 76c931dcf5cf..d6a7eefb2413 100644 --- a/test/resolver_update_test.go +++ b/test/resolver_update_test.go @@ -205,15 +205,15 @@ func (s) TestResolverUpdate_InvalidServiceConfigAfterGoodUpdate(t *testing.T) { addrs := []resolver.Address{{Addr: backend.Address}} const lbCfg = "wrapping balancer LB policy config" goodSC := r.CC.ParseServiceConfig(fmt.Sprintf(` - { - "loadBalancingConfig": [ - { - "%v": { - "config": "%s" - } - } - ] - }`, t.Name(), lbCfg)) +{ + "loadBalancingConfig": [ + { + "%v": { + "config": "%s" + } + } + ] +}`, t.Name(), lbCfg)) r.UpdateState(resolver.State{Addresses: addrs, ServiceConfig: goodSC}) ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) diff --git a/test/xds/xds_client_certificate_providers_test.go b/test/xds/xds_client_certificate_providers_test.go index 5cdfb3f7ec84..af580cb47085 100644 --- a/test/xds/xds_client_certificate_providers_test.go +++ b/test/xds/xds_client_certificate_providers_test.go @@ -119,9 +119,9 @@ func (s) TestClientSideXDS_WithNoCertificateProvidersInBootstrap_Failure(t *test nodeID := uuid.New().String() bc, err := bootstrap.NewContentsForTesting(bootstrap.ConfigOptionsForTesting{ Servers: []byte(fmt.Sprintf(`[{ - "server_uri": %q, - "channel_creds": [{"type": "insecure"}] - }]`, mgmtServer.Address)), + "server_uri": %q, + "channel_creds": [{"type": "insecure"}] + }]`, mgmtServer.Address)), Node: []byte(fmt.Sprintf(`{"id": "%s"}`, nodeID)), }) if err != nil {