forked from TrueCloudLab/distribution
feat: add tparallel linter to improve handling (parallel) tests (#4173)
This commit is contained in:
commit
30b642ebf6
3 changed files with 3 additions and 1 deletions
|
@ -12,6 +12,7 @@ linters:
|
||||||
- bodyclose
|
- bodyclose
|
||||||
- prealloc
|
- prealloc
|
||||||
- errcheck
|
- errcheck
|
||||||
|
- tparallel
|
||||||
|
|
||||||
linters-settings:
|
linters-settings:
|
||||||
revive:
|
revive:
|
||||||
|
|
|
@ -34,7 +34,7 @@ func TestWithTrace(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, done := WithTrace(Background())
|
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{
|
tests := append(base, valueTestCase{
|
||||||
key: "trace.func",
|
key: "trace.func",
|
||||||
|
|
|
@ -33,6 +33,7 @@ func TestErrorFormat(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestErrors(t *testing.T) {
|
func TestErrors(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
drvName := "foo"
|
drvName := "foo"
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
|
|
Loading…
Reference in a new issue