1
0
mirror of https://github.com/golang/go synced 2024-11-07 06:46:12 -07:00
go/src/testing
Paschalis Tsilias cbb3f09047 testing: add -shuffle=off|on|N to alter the execution order of tests and benchmarks
This CL adds a new flag to the testing package and the go test command
which randomizes the execution order for tests and benchmarks.
This can be useful for identifying unwanted dependencies
between test or benchmark functions.
The flag is off by default. If `-shuffle` is set to `on` then the system
clock will be used as the seed value. If `-shuffle` is set to an integer
N, then N will be used as the seed value. In both cases, the seed will
be reported for failed runs so that they can reproduced later on.

Fixes #28592

Change-Id: I62e7dfae5f63f97a0cbd7830ea844d9f7beac335
Reviewed-on: https://go-review.googlesource.com/c/go/+/310033
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Trust: Bryan C. Mills <bcmills@google.com>
2021-04-28 16:06:21 +00:00
..
fstest io/fs: document that caller can modify slice returned by ReadFile 2021-04-21 16:46:52 +00:00
internal/testdeps cmd/go, testing, os: fail test that calls os.Exit(0) 2020-08-27 23:19:15 +00:00
iotest all: update references to symbols moved from io/ioutil to io 2020-10-20 18:41:18 +00:00
quick
allocs_test.go
allocs.go
benchmark_test.go testing: remove data races so that parallel benchmarks can safely call .Fatal* and .Skip* 2021-04-19 22:06:05 +00:00
benchmark.go testing: remove data races so that parallel benchmarks can safely call .Fatal* and .Skip* 2021-04-19 22:06:05 +00:00
cover.go
example.go testing: fail Example tests that invoke runtime.Goexit 2020-09-01 20:13:34 +00:00
export_test.go
helper_test.go testing: update helperNames just before checking it 2021-03-19 01:04:37 +00:00
helperfuncs_test.go testing: fix reported caller name for funcs passed to Cleanup 2020-05-05 22:44:36 +00:00
match_test.go
match.go
panic_test.go testing: don't run Cleanup functions until parallel subtests complete 2020-01-16 21:32:12 +00:00
run_example_js.go all: go fmt std cmd (but revert vendor) 2021-02-20 03:54:50 +00:00
run_example.go all: go fmt std cmd (but revert vendor) 2021-02-20 03:54:50 +00:00
sub_test.go testing: print late arriving log line in panic 2021-02-24 16:38:56 +00:00
testing_test.go testing: add TB.Setenv 2021-03-05 11:58:31 +00:00
testing.go testing: add -shuffle=off|on|N to alter the execution order of tests and benchmarks 2021-04-28 16:06:21 +00:00