...
1[short] skip
2
3go test ./...
4stdout 'pkg1(.|\n)*pkg2'
5
6-- go.mod --
7module m
8
9-- pkg1/x_test.go --
10package pkg1
11
12import (
13 "testing"
14 "time"
15)
16
17func Test(t *testing.T) {
18 // This sleep makes it more likely that pkg2 will be ready before pkg1,
19 // which previously would have made this test fail, because pkg2 would
20 // be printed before pkg1.
21 // Now that there is proper ordering, the Sleep should not matter.
22 // In particular, the Sleep does not make the test pass and won't
23 // be a problem on slow builders.
24 time.Sleep(1*time.Second)
25}
26-- pkg2/x.go --
27package pkg2
View as plain text