mirror of
https://github.com/distribution/distribution
synced 2024-12-25 15:05:51 +01:00
feat: add tparallel linter to improve handling parallel tests
This linter both prevents parallel test races as well as suggests parallel tests where appropriate: See: https://github.com/moricho/tparallel Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
This commit is contained in:
parent
f71b32894a
commit
b3681c4cd3
@ -12,6 +12,7 @@ linters:
|
||||
- bodyclose
|
||||
- prealloc
|
||||
- errcheck
|
||||
- tparallel
|
||||
|
||||
linters-settings:
|
||||
revive:
|
||||
|
@ -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",
|
||||
|
@ -33,6 +33,7 @@ func TestErrorFormat(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestErrors(t *testing.T) {
|
||||
t.Parallel()
|
||||
drvName := "foo"
|
||||
|
||||
testCases := []struct {
|
||||
|
Loading…
Reference in New Issue
Block a user