Skip to content

Commit ae836e6

Browse files
committed
chore(multiclient): fix linter issues
1 parent 6cff0a9 commit ae836e6

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

deployment/multiclient_test.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,19 +184,26 @@ func TestMultiClient_retryWithBackups(t *testing.T) {
184184
func TestEnsureTimeout(t *testing.T) {
185185
t.Parallel()
186186

187+
var (
188+
ctxNoTimeout = context.Background()
189+
ctxWithTimeout, cancel = context.WithTimeout(context.Background(), 2*time.Minute)
190+
)
191+
192+
defer cancel()
193+
187194
tests := []struct {
188195
name string
189-
parentContext context.Context
196+
parentContext context.Context //nolint:containedctx
190197
timeout time.Duration
191198
}{
192199
{
193200
name: "Parent context with deadline",
194-
parentContext: func() context.Context { ctx, _ := context.WithTimeout(context.Background(), 2*time.Minute); return ctx }(),
201+
parentContext: ctxWithTimeout,
195202
timeout: 1 * time.Minute,
196203
},
197204
{
198205
name: "Parent context without deadline",
199-
parentContext: context.Background(),
206+
parentContext: ctxNoTimeout,
200207
timeout: 1 * time.Minute,
201208
},
202209
}

0 commit comments

Comments
 (0)