runtime: deflake TestStackMem

The problem is that there are lots of dead G's from previous tests,
each dead G consumes 1 stack segment.
Fixes #5034.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7749043
This commit is contained in:
Dmitriy Vyukov 2013-03-12 15:19:06 +04:00
parent e0fd6d08b2
commit 7f070af515
1 changed files with 4 additions and 2 deletions

View File

@ -1576,7 +1576,9 @@ func TestStackMem(t *testing.T) {
if consumed > estimate {
t.Fatalf("Stack mem: want %v, got %v", estimate, consumed)
}
if s1.StackInuse > 4<<20 {
t.Fatalf("Stack inuse: want %v, got %v", 4<<20, s1.StackInuse)
inuse := s1.StackInuse - s0.StackInuse
t.Logf("Inuse %vMB for stack mem", inuse>>20)
if inuse > 4<<20 {
t.Fatalf("Stack inuse: want %v, got %v", 4<<20, inuse)
}
}