Commit e6b02347 authored by Rémy Oudompheng's avatar Rémy Oudompheng

runtime: reduce delays in finalizer test.

The runtime tests are executed 4 times in all.bash
and there is currently a 5-second delay each time.

R=golang-dev, minux.ma, khr, bradfitz
CC=golang-dev
https://golang.org/cl/42450043
parent 16dcef80
......@@ -46,13 +46,15 @@ func TestFinalizerType(t *testing.T) {
}
for _, tt := range finalizerTests {
done := make(chan bool, 1)
go func() {
v := new(int)
*v = 97531
runtime.SetFinalizer(tt.convert(v), tt.finalizer)
v = nil
done <- true
}()
time.Sleep(1 * time.Second)
<-done
runtime.GC()
select {
case <-ch:
......@@ -73,6 +75,7 @@ func TestFinalizerInterfaceBig(t *testing.T) {
t.Skipf("Skipping on non-amd64 machine")
}
ch := make(chan bool)
done := make(chan bool, 1)
go func() {
v := &bigValue{0xDEADBEEFDEADBEEF, true, "It matters not how strait the gate"}
old := *v
......@@ -87,8 +90,9 @@ func TestFinalizerInterfaceBig(t *testing.T) {
close(ch)
})
v = nil
done <- true
}()
time.Sleep(1 * time.Second)
<-done
runtime.GC()
select {
case <-ch:
......
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