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/testdata | |
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/testdata')
-rw-r--r-- | src/runtime/testdata/testprog/deadlock.go | 4 | ||||
-rw-r--r-- | src/runtime/testdata/testprog/sleep.go | 17 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/runtime/testdata/testprog/deadlock.go b/src/runtime/testdata/testprog/deadlock.go index ca2be57911..5f0d120004 100644 --- a/src/runtime/testdata/testprog/deadlock.go +++ b/src/runtime/testdata/testprog/deadlock.go @@ -112,12 +112,16 @@ func RecursivePanic() { } func GoexitExit() { + println("t1") go func() { time.Sleep(time.Millisecond) }() i := 0 + println("t2") runtime.SetFinalizer(&i, func(p *int) {}) + println("t3") runtime.GC() + println("t4") runtime.Goexit() } diff --git a/src/runtime/testdata/testprog/sleep.go b/src/runtime/testdata/testprog/sleep.go new file mode 100644 index 0000000000..86e2f6cfe6 --- /dev/null +++ b/src/runtime/testdata/testprog/sleep.go @@ -0,0 +1,17 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +import "time" + +// for golang.org/issue/27250 + +func init() { + register("After1", After1) +} + +func After1() { + <-time.After(1 * time.Second) +} |