It runs too long in -short mode.
Disable the one in init, because it doesn't respect -short.
Make the part that claims to test execution in a finalizer
actually execute the test in the finalizer.
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=aram.h, golang-codereviews, iant, khr
https://golang.org/cl/
86550045
defer wg.Done()
growStack()
}()
+ wg.Wait()
// in locked goroutine
wg.Add(1)
growStack()
UnlockOSThread()
}()
+ wg.Wait()
// in finalizer
wg.Add(1)
go func() {
s := new(string)
SetFinalizer(s, func(ss *string) {
+ growStack()
done <- true
})
s = nil
t.Fatal("finalizer did not run")
}
}()
-
wg.Wait()
}
// ... and in init
-func init() {
- growStack()
-}
+//func init() {
+// growStack()
+//}
func growStack() {
- for i := 0; i < 1<<10; i++ {
+ n := 1 << 10
+ if testing.Short() {
+ n = 1 << 8
+ }
+ for i := 0; i < n; i++ {
x := 0
growStackIter(&x, i)
if x != i+1 {