Commit b56e2478 authored by Ian Lance Taylor's avatar Ian Lance Taylor Committed by Brad Fitzpatrick

runtime: scale timeout in TestStackGrowth

Updates #19381

Change-Id: I62b8b0cd7170941af77281eb3aada3802623ec27
Reviewed-on: https://go-review.googlesource.com/122587Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent d82256ac
...@@ -7,9 +7,11 @@ package runtime_test ...@@ -7,9 +7,11 @@ package runtime_test
import ( import (
"bytes" "bytes"
"fmt" "fmt"
"os"
"reflect" "reflect"
"regexp" "regexp"
. "runtime" . "runtime"
"strconv"
"strings" "strings"
"sync" "sync"
"sync/atomic" "sync/atomic"
...@@ -126,9 +128,18 @@ func TestStackGrowth(t *testing.T) { ...@@ -126,9 +128,18 @@ func TestStackGrowth(t *testing.T) {
}() }()
<-done <-done
GC() 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 { select {
case <-done: case <-done:
case <-time.After(20 * time.Second): case <-time.After(timeout):
if atomic.LoadUint32(&started) == 0 { if atomic.LoadUint32(&started) == 0 {
t.Log("finalizer did not start") t.Log("finalizer did not start")
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment