diff --git a/tests/integrations/client/client_test.go b/tests/integrations/client/client_test.go index 4ff3a6960a6..3a16a6de162 100644 --- a/tests/integrations/client/client_test.go +++ b/tests/integrations/client/client_test.go @@ -2070,7 +2070,7 @@ func TestCircuitBreaker(t *testing.T) { cli := setupCli(ctx, re, endpoints, opt.WithRegionMetaCircuitBreaker(circuitBreakerSettings)) defer cli.Close() - for i := 0; i < 10; i++ { + for range 10 { region, err := cli.GetRegion(context.TODO(), []byte("a")) re.NoError(err) re.NotNil(region) @@ -2078,7 +2078,7 @@ func TestCircuitBreaker(t *testing.T) { re.NoError(failpoint.Enable("github.com/tikv/pd/client/triggerCircuitBreaker", "return(true)")) - for i := 0; i < 100; i++ { + for range 100 { _, err := cli.GetRegion(context.TODO(), []byte("a")) re.Error(err) } @@ -2095,7 +2095,7 @@ func TestCircuitBreaker(t *testing.T) { // wait cooldown time.Sleep(time.Second) - for i := 0; i < 10; i++ { + for range 10 { region, err := cli.GetRegion(context.TODO(), []byte("a")) re.NoError(err) re.NotNil(region) @@ -2123,7 +2123,7 @@ func TestCircuitBreakerChangeSettings(t *testing.T) { cli := setupCli(ctx, re, endpoints, opt.WithRegionMetaCircuitBreaker(circuitBreakerSettings)) defer cli.Close() - for i := 0; i < 10; i++ { + for range 10 { region, err := cli.GetRegion(context.TODO(), []byte("a")) re.NoError(err) re.NotNil(region) @@ -2131,7 +2131,7 @@ func TestCircuitBreakerChangeSettings(t *testing.T) { re.NoError(failpoint.Enable("github.com/tikv/pd/client/triggerCircuitBreaker", "return(true)")) - for i := 0; i < 100; i++ { + for range 100 { _, err := cli.GetRegion(context.TODO(), []byte("a")) re.Error(err) }