We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d82256a commit b56e247Copy full SHA for b56e247
src/runtime/stack_test.go
@@ -7,9 +7,11 @@ package runtime_test
7
import (
8
"bytes"
9
"fmt"
10
+ "os"
11
"reflect"
12
"regexp"
13
. "runtime"
14
+ "strconv"
15
"strings"
16
"sync"
17
"sync/atomic"
@@ -126,9 +128,18 @@ func TestStackGrowth(t *testing.T) {
126
128
}()
127
129
<-done
130
GC()
131
+
132
+ timeout := 20 * time.Second
133
+ if s := os.Getenv("GO_TEST_TIMEOUT_SCALE"); s != "" {
134
+ scale, err := strconv.Atoi(s)
135
+ if err == nil {
136
+ timeout *= time.Duration(scale)
137
+ }
138
139
140
select {
141
case <-done:
- case <-time.After(20 * time.Second):
142
+ case <-time.After(timeout):
143
if atomic.LoadUint32(&started) == 0 {
144
t.Log("finalizer did not start")
145
} else {
0 commit comments