Skip to content

Commit 1f233c8

Browse files
author
Furkhat Kasymov Genii Uulu
committed
add t.Parallel
1 parent 18d191c commit 1f233c8

File tree

9 files changed

+26
-0
lines changed

9 files changed

+26
-0
lines changed

internal/actions/csr/integration_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
)
3030

3131
func TestIntegration(t *testing.T) {
32+
t.Parallel()
3233
testIntegration(t, certv1.SchemeGroupVersion)
3334
testIntegration(t, certv1beta1.SchemeGroupVersion)
3435
}

internal/castai/client_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
)
88

99
func TestNewRestryClient_TLS(t *testing.T) {
10+
t.Parallel()
1011
t.Run("should populate tls.Config RootCAs when valid certificate presented", func(t *testing.T) {
1112
r := require.New(t)
1213

internal/config/config_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
)
1212

1313
func TestConfig(t *testing.T) {
14+
t.Parallel()
1415
clusterId := uuid.New().String()
1516
require.NoError(t, os.Setenv("API_KEY", "abc"))
1617
require.NoError(t, os.Setenv("API_URL", "api.cast.ai"))

internal/config/retry_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
)
1414

1515
func TestKubeRetryTransport(t *testing.T) {
16+
t.Parallel()
1617
log := logrus.New()
1718
log.SetLevel(logrus.DebugLevel)
1819

internal/helm/chart_loader_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
)
1313

1414
func TestIntegration_ChartLoader(t *testing.T) {
15+
t.Parallel()
1516
r := require.New(t)
1617
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
1718
defer cancel()

internal/helm/client_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
)
2121

2222
func TestClientInstall(t *testing.T) {
23+
t.Parallel()
2324
r := require.New(t)
2425

2526
client := &client{
@@ -47,6 +48,7 @@ func TestClientInstall(t *testing.T) {
4748
}
4849

4950
func TestClientUpdate(t *testing.T) {
51+
t.Parallel()
5052
r := require.New(t)
5153

5254
currentRelease := buildNginxIngressRelease(release.StatusDeployed)
@@ -76,6 +78,7 @@ func TestClientUpdate(t *testing.T) {
7678
}
7779

7880
func TestClientUpdateResetThenReuseValue(t *testing.T) {
81+
t.Parallel()
7982
r := require.New(t)
8083

8184
currentRelease := buildNginxIngressRelease(release.StatusDeployed)
@@ -106,6 +109,7 @@ func TestClientUpdateResetThenReuseValue(t *testing.T) {
106109
}
107110

108111
func TestClientUninstall(t *testing.T) {
112+
t.Parallel()
109113
r := require.New(t)
110114

111115
currentRelease := buildNginxIngressRelease(release.StatusDeployed)

internal/k8sversion/version_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
)
1414

1515
func Test(t *testing.T) {
16+
t.Parallel()
1617
v := version.Info{
1718
Major: "1",
1819
Minor: "21+",

internal/monitor/metatada_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
)
1515

1616
func TestSaveMetadata(t *testing.T) {
17+
t.Parallel()
1718
tests := map[string]struct {
1819
createDir string
1920
file string
@@ -61,6 +62,7 @@ func TestSaveMetadata(t *testing.T) {
6162
}
6263

6364
func Test_monitor_waitForMetadata(t *testing.T) {
65+
t.Parallel()
6466
ctx, cancel := context.WithTimeout(context.Background(), time.Second*30)
6567
defer cancel()
6668

internal/waitext/extensions_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
)
1313

1414
func TestNewConstantBackoff(t *testing.T) {
15+
t.Parallel()
1516
r := require.New(t)
1617
expectedSleepDuration := 10 * time.Second
1718
backoff := NewConstantBackoff(expectedSleepDuration)
@@ -22,6 +23,7 @@ func TestNewConstantBackoff(t *testing.T) {
2223
}
2324

2425
func TestDefaultExponentialBackoff(t *testing.T) {
26+
t.Parallel()
2527
r := require.New(t)
2628

2729
val := DefaultExponentialBackoff()
@@ -33,10 +35,13 @@ func TestDefaultExponentialBackoff(t *testing.T) {
3335
}
3436

3537
func TestRetry(t *testing.T) {
38+
t.Parallel()
3639
r := require.New(t)
3740

3841
t.Run("Retrying logic tests", func(t *testing.T) {
42+
t.Parallel()
3943
t.Run("Called at least once, even if retries or steps is 0", func(t *testing.T) {
44+
t.Parallel()
4045
called := false
4146
err := Retry(context.Background(), wait.Backoff{Steps: 0}, 0, func(_ context.Context) (bool, error) {
4247
called = true
@@ -48,6 +53,7 @@ func TestRetry(t *testing.T) {
4853
})
4954

5055
t.Run("Respects backoff and retry count", func(t *testing.T) {
56+
t.Parallel()
5157
retries := 4
5258
expectedTotalExecutions := 1 + retries
5359
backoff := DefaultExponentialBackoff()
@@ -88,6 +94,7 @@ func TestRetry(t *testing.T) {
8894
})
8995

9096
t.Run("Returns last encountered error", func(t *testing.T) {
97+
t.Parallel()
9198
timesCalled := 0
9299
expectedErrMessage := "boom 3"
93100

@@ -101,6 +108,7 @@ func TestRetry(t *testing.T) {
101108
})
102109

103110
t.Run("Does not retry if false is returned as first parameter", func(t *testing.T) {
111+
t.Parallel()
104112
expectedErr := errors.New("dummy")
105113
called := false
106114
err := Retry(context.Background(), NewConstantBackoff(10*time.Millisecond), 10,
@@ -115,7 +123,9 @@ func TestRetry(t *testing.T) {
115123
})
116124

117125
t.Run("Notify callback tests", func(t *testing.T) {
126+
t.Parallel()
118127
t.Run("Notify is passed and called", func(t *testing.T) {
128+
t.Parallel()
119129
err := Retry(
120130
context.Background(),
121131
NewConstantBackoff(10*time.Millisecond),
@@ -131,6 +141,7 @@ func TestRetry(t *testing.T) {
131141
})
132142

133143
t.Run("Notify is not passed, no panic", func(t *testing.T) {
144+
t.Parallel()
134145
err := Retry(
135146
context.Background(),
136147
NewConstantBackoff(10*time.Millisecond),
@@ -145,7 +156,9 @@ func TestRetry(t *testing.T) {
145156
})
146157

147158
t.Run("Context tests", func(t *testing.T) {
159+
t.Parallel()
148160
t.Run("On context cancel, stops", func(t *testing.T) {
161+
t.Parallel()
149162
ctx, cancel := context.WithCancelCause(context.Background())
150163

151164
innerError := errors.New("from operation")
@@ -168,6 +181,7 @@ func TestRetry(t *testing.T) {
168181
})
169182

170183
t.Run("Operation is called at least once, even if context is cancelled", func(t *testing.T) {
184+
t.Parallel()
171185
ctx, cancel := context.WithCancel(context.Background())
172186
cancel()
173187

0 commit comments

Comments
 (0)