1
0
mirror of https://github.com/golang/go synced 2024-09-23 11:20:17 -06:00

cmd/api: skip TestIssue29837 when -short is set

TestIssue29837 takes a long time to run, ~150s on my laptop
and ~40s on CI builders.

While here, warm up the go list cache in parallel, which reduces the
test time by ~10%.

Change-Id: Ib8d45b086453ee03e6c9f3f070d6f6b0d324bfd4
Reviewed-on: https://go-review.googlesource.com/c/go/+/502095
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This commit is contained in:
qmuntal 2023-06-09 17:41:36 +02:00 committed by Quim Muntal
parent 9fc84363d1
commit c5463218a2

View File

@ -209,16 +209,7 @@ func BenchmarkAll(b *testing.B) {
}
}
func TestIssue21181(t *testing.T) {
if testing.Short() {
t.Skip("skipping with -short")
}
if *flagCheck {
// slow, not worth repeating in -check
t.Skip("skipping with -check set")
}
testenv.MustHaveGoBuild(t)
var warmupCache = sync.OnceFunc(func() {
// Warm up the import cache in parallel.
var wg sync.WaitGroup
for _, context := range contexts {
@ -230,6 +221,19 @@ func TestIssue21181(t *testing.T) {
}()
}
wg.Wait()
})
func TestIssue21181(t *testing.T) {
if testing.Short() {
t.Skip("skipping with -short")
}
if *flagCheck {
// slow, not worth repeating in -check
t.Skip("skipping with -check set")
}
testenv.MustHaveGoBuild(t)
warmupCache()
for _, context := range contexts {
w := NewWalker(context, "testdata/src/issue21181")
@ -243,11 +247,17 @@ func TestIssue21181(t *testing.T) {
}
func TestIssue29837(t *testing.T) {
if testing.Short() {
t.Skip("skipping with -short")
}
if *flagCheck {
// slow, not worth repeating in -check
t.Skip("skipping with -check set")
}
testenv.MustHaveGoBuild(t)
warmupCache()
for _, context := range contexts {
w := NewWalker(context, "testdata/src/issue29837")
_, err := w.ImportFrom("p", "", 0)