aboutsummaryrefslogtreecommitdiff
path: root/src/go
diff options
context:
space:
mode:
authorPaschalis Tsilias <paschalis.tsilias@gmail.com>2021-04-14 23:55:38 +0300
committerIan Lance Taylor <iant@golang.org>2021-04-28 16:06:21 +0000
commitcbb3f090477de92a7e158050803ef71a5ea825ee (patch)
treef8cb18236c1fb9ca9d19db1c2586086516b8a9b8 /src/go
parente51246c8819f16cd78d3da01162ca14b432d30bc (diff)
downloadgo-cbb3f090477de92a7e158050803ef71a5ea825ee.tar.gz
go-cbb3f090477de92a7e158050803ef71a5ea825ee.zip
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>
Diffstat (limited to 'src/go')
-rw-r--r--src/go/build/deps_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/go/build/deps_test.go b/src/go/build/deps_test.go
index 1b93348edb..9cdfb898ba 100644
--- a/src/go/build/deps_test.go
+++ b/src/go/build/deps_test.go
@@ -503,7 +503,7 @@ var depsRules = `
FMT, flag, math/rand
< testing/quick;
- FMT, flag, runtime/debug, runtime/trace, internal/sysinfo
+ FMT, flag, runtime/debug, runtime/trace, internal/sysinfo, math/rand
< testing;
internal/testlog, runtime/pprof, regexp