aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/stack_test.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2018-07-08 17:02:48 -0700
committerBrad Fitzpatrick <bradfitz@golang.org>2018-07-09 02:18:16 +0000
commitb56e24782f81002fabe06bdf65a735ac7e2b6e1f (patch)
treed5b13e79792bef1710b0946836838386539654ca /src/runtime/stack_test.go
parentd82256ac11762f9e5069d84065de89919c337d58 (diff)
downloadgo-b56e24782f81002fabe06bdf65a735ac7e2b6e1f.tar.gz
go-b56e24782f81002fabe06bdf65a735ac7e2b6e1f.zip
runtime: scale timeout in TestStackGrowth
Updates #19381 Change-Id: I62b8b0cd7170941af77281eb3aada3802623ec27 Reviewed-on: https://go-review.googlesource.com/122587 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/runtime/stack_test.go')
-rw-r--r--src/runtime/stack_test.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/runtime/stack_test.go b/src/runtime/stack_test.go
index 5d674470c1..dc65395141 100644
--- a/src/runtime/stack_test.go
+++ b/src/runtime/stack_test.go
@@ -7,9 +7,11 @@ package runtime_test
import (
"bytes"
"fmt"
+ "os"
"reflect"
"regexp"
. "runtime"
+ "strconv"
"strings"
"sync"
"sync/atomic"
@@ -126,9 +128,18 @@ func TestStackGrowth(t *testing.T) {
}()
<-done
GC()
+
+ timeout := 20 * time.Second
+ if s := os.Getenv("GO_TEST_TIMEOUT_SCALE"); s != "" {
+ scale, err := strconv.Atoi(s)
+ if err == nil {
+ timeout *= time.Duration(scale)
+ }
+ }
+
select {
case <-done:
- case <-time.After(20 * time.Second):
+ case <-time.After(timeout):
if atomic.LoadUint32(&started) == 0 {
t.Log("finalizer did not start")
} else {