Commit 7f070af5 authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

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
parent e0fd6d08
......@@ -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)
}
}
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