Skip to content

Commit

Permalink
test(storage): fix context timeout logic (#10232)
Browse files Browse the repository at this point in the history
Some tests had logic in t.Cleanup using the same context. Move context cancellation to t.Cleanup as well so that the cancel happens after this logic executes.

Fixes #10229
  • Loading branch information
tritone authored May 20, 2024
1 parent 78f3d9e commit cb965ed
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion storage/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ func multiTransportTest(ctx context.Context, t *testing.T,
// Don't let any individual test run more than 5 minutes. This eases debugging if
// test runs get stalled out.
ctx, cancel := context.WithTimeout(ctx, 5*time.Minute)
defer cancel()
t.Cleanup(func() {
cancel()
})

test(t, ctx, bucket, prefix, client)
})
Expand Down

0 comments on commit cb965ed

Please sign in to comment.