diff --git a/.golangci.yml b/.golangci.yml index a6dfe5ca..ec637d63 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -12,6 +12,7 @@ linters: - bodyclose - prealloc - errcheck + - tparallel linters-settings: revive: diff --git a/internal/dcontext/trace_test.go b/internal/dcontext/trace_test.go index bb6d1779..719fa37b 100644 --- a/internal/dcontext/trace_test.go +++ b/internal/dcontext/trace_test.go @@ -34,7 +34,7 @@ func TestWithTrace(t *testing.T) { } ctx, done := WithTrace(Background()) - defer done("this will be emitted at end of test") + t.Cleanup(func() { done("this will be emitted at end of test") }) tests := append(base, valueTestCase{ key: "trace.func", diff --git a/registry/storage/driver/errors_test.go b/registry/storage/driver/errors_test.go index f692466f..5831dd98 100644 --- a/registry/storage/driver/errors_test.go +++ b/registry/storage/driver/errors_test.go @@ -33,6 +33,7 @@ func TestErrorFormat(t *testing.T) { } func TestErrors(t *testing.T) { + t.Parallel() drvName := "foo" testCases := []struct {