diff options
author | Brad Fitzpatrick <bradfitz@golang.org> | 2019-05-05 02:25:42 +0000 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2019-05-06 23:02:29 +0000 |
commit | 6b1ac8290f189709273c9d4b402e14421f21eda0 (patch) | |
tree | 85935de699d0bac04e818f8ba12592011063e460 /src/run.bash | |
parent | ed7f323c8f4f6bc61a75146bf34f5b8f73063a17 (diff) | |
download | go-6b1ac8290f189709273c9d4b402e14421f21eda0.tar.gz go-6b1ac8290f189709273c9d4b402e14421f21eda0.zip |
cmd/dist: allow builders to control granularity of test/ directory sharding
Even with 10 shards on builders, it still takes about ~2.5 minutes per
shard (and getting slower all the time as the test/ directory grows).
I'm currently experimenting with massively sharding out testing on
Cloud Run (each dist test & normal TestFoo func all running in
parallel), and in such a setup, 2.5 minutes is an eternity. I'd like
to increase that dist test's sharding from 10 to more like 1,000.
Updates golang/go#31834
Change-Id: I8b02989727793b5b5b2013d67e1eb01ef4786e28
Reviewed-on: https://go-review.googlesource.com/c/go/+/175297
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/run.bash')
-rwxr-xr-x | src/run.bash | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/run.bash b/src/run.bash index 1acd0194b6..e18540c990 100755 --- a/src/run.bash +++ b/src/run.bash @@ -3,6 +3,17 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. +# Environment variables that control run.bash: +# +# GO_TEST_SHARDS: number of "dist test" test shards that the +# $GOROOT/test directory will be sliced up into for parallel +# execution. Defaults to 1, unless GO_BUILDER_NAME is also specified, +# in which case it defaults to 10. +# +# GO_BUILDER_NAME: the name of the Go builder that's running the tests. +# Some tests are conditionally enabled or disabled based on the builder +# name or the builder name being non-empty. + set -e eval $(go env) |