diff --git a/base/logging_context.go b/base/logging_context.go index 3231b299f5..03da897e3e 100644 --- a/base/logging_context.go +++ b/base/logging_context.go @@ -176,9 +176,7 @@ func NewTaskID(contextID string, taskName string) string { // TestCtx creates a context for the given test which is also cancelled once the test has completed. func TestCtx(t testing.TB) context.Context { - ctx, cancelCtx := context.WithCancel(context.Background()) - t.Cleanup(cancelCtx) - return LogContextWith(ctx, &LogContext{TestName: t.Name()}) + return LogContextWith(t.Context(), &LogContext{TestName: t.Name()}) } // BucketCtx extends the parent context with a bucket name.