diff options
author | Russ Cox <rsc@golang.org> | 2019-05-15 20:49:39 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2019-05-22 12:54:00 +0000 |
commit | 06b0babf3138d189f6e741561f77ac6146696377 (patch) | |
tree | 04cda16449e7f9dfdd9e14926ef78e4e0d61be78 /src/runtime/internal | |
parent | b0e238add5dc8ab80b4eade78ca047f074658dcd (diff) | |
download | go-06b0babf3138d189f6e741561f77ac6146696377.tar.gz go-06b0babf3138d189f6e741561f77ac6146696377.zip |
all: shorten some tests
Shorten some of the longest tests that run during all.bash.
Removes 7r 50u 21s from all.bash.
After this change, all.bash is under 5 minutes again on my laptop.
For #26473.
Change-Id: Ie0460aa935808d65460408feaed210fbaa1d5d79
Reviewed-on: https://go-review.googlesource.com/c/go/+/177559
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/internal')
-rw-r--r-- | src/runtime/internal/atomic/atomic_test.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/runtime/internal/atomic/atomic_test.go b/src/runtime/internal/atomic/atomic_test.go index 25ece4354e..0ba75447e8 100644 --- a/src/runtime/internal/atomic/atomic_test.go +++ b/src/runtime/internal/atomic/atomic_test.go @@ -29,14 +29,18 @@ func runParallel(N, iter int, f func()) { } func TestXadduintptr(t *testing.T) { - const N = 20 - const iter = 100000 + N := 20 + iter := 100000 + if testing.Short() { + N = 10 + iter = 10000 + } inc := uintptr(100) total := uintptr(0) runParallel(N, iter, func() { atomic.Xadduintptr(&total, inc) }) - if want := uintptr(N * iter * inc); want != total { + if want := uintptr(N*iter) * inc; want != total { t.Fatalf("xadduintpr error, want %d, got %d", want, total) } total = 0 |