Updates #19381
Change-Id: I62b8b0cd7170941af77281eb3aada3802623ec27
Reviewed-on: https://go-review.googlesource.com/122587
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
import (
"bytes"
"fmt"
+ "os"
"reflect"
"regexp"
. "runtime"
+ "strconv"
"strings"
"sync"
"sync/atomic"
}()
<-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 {