diff options
| author | Bryan C. Mills <bcmills@google.com> | 2023-01-10 15:59:12 -0500 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2023-01-19 20:46:11 +0000 |
| commit | c16c2c49e2fa98ae551fc6335215fadd62d33542 (patch) | |
| tree | 511f11dd7b86afa615fbed3ec8c4d4484194046e /src | |
| parent | 2f8f51724ad2a3509603d53d8a850f9146e4016f (diff) | |
| download | go-c16c2c49e2fa98ae551fc6335215fadd62d33542.tar.xz | |
cmd/go: shorten TestScript/test_shuffle and skip it in short mode
test_shuffle was added in CL 310033. It takes about 4½ seconds on my
workstation prior to this CL, most of which is spent linking and
running test binaries in 'go test'.
We can reduce that time somewhat (to 3¾ seconds) by simply running the
test fewer times (cases of 'off', 'on', positive, zero, and negative
values seem sufficient), but we should also avoid that linking
overhead at all in short mode.
Fixes #57709.
Change-Id: I908a70435ccfb1ca16ed23aec17512bf2b267b21
Reviewed-on: https://go-review.googlesource.com/c/go/+/461455
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/go/testdata/script/test_shuffle.txt | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/cmd/go/testdata/script/test_shuffle.txt b/src/cmd/go/testdata/script/test_shuffle.txt index 3a50605c34..98029f552d 100644 --- a/src/cmd/go/testdata/script/test_shuffle.txt +++ b/src/cmd/go/testdata/script/test_shuffle.txt @@ -1,5 +1,7 @@ # Shuffle order of tests and benchmarks +[short] skip 'builds and repeatedly runs a test binary' + # Run tests go test -v foo_test.go ! stdout '-test.shuffle ' @@ -13,14 +15,6 @@ go test -v -shuffle=42 foo_test.go stdout '^-test.shuffle 42' stdout '(?s)TestThree(.*)TestOne(.*)TestTwo' -go test -v -shuffle=43 foo_test.go -stdout '^-test.shuffle 43' -stdout '(?s)TestThree(.*)TestTwo(.*)TestOne' - -go test -v -shuffle=44 foo_test.go -stdout '^-test.shuffle 44' -stdout '(?s)TestOne(.*)TestThree(.*)TestTwo' - go test -v -shuffle=0 foo_test.go stdout '^-test.shuffle 0' stdout '(?s)TestTwo(.*)TestOne(.*)TestThree' @@ -49,14 +43,6 @@ go test -v -bench=. -shuffle=42 foo_test.go stdout '^-test.shuffle 42' stdout '(?s)TestThree(.*)TestOne(.*)TestTwo(.*)BenchmarkThree(.*)BenchmarkOne(.*)BenchmarkTwo' -go test -v -bench=. -shuffle=43 foo_test.go -stdout '^-test.shuffle 43' -stdout '(?s)TestThree(.*)TestTwo(.*)TestOne(.*)BenchmarkThree(.*)BenchmarkOne(.*)BenchmarkTwo' - -go test -v -bench=. -shuffle=44 foo_test.go -stdout '^-test.shuffle 44' -stdout '(?s)TestOne(.*)TestThree(.*)TestTwo(.*)BenchmarkTwo(.*)BenchmarkOne(.*)BenchmarkThree' - go test -v -bench=. -shuffle=0 foo_test.go stdout '^-test.shuffle 0' stdout '(?s)TestTwo(.*)TestOne(.*)TestThree(.*)BenchmarkThree(.*)BenchmarkOne(.*)BenchmarkTwo' |
