]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: deflake TestStackMem
authorDmitriy Vyukov <dvyukov@google.com>
Tue, 12 Mar 2013 11:19:06 +0000 (15:19 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Tue, 12 Mar 2013 11:19:06 +0000 (15:19 +0400)
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

src/pkg/runtime/stack_test.go

index 74f29f34ec02a8b34f40308a9837ee498059b737..da0181a66e60cdbe22ee6795b3a22869aed1aba2 100644 (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)
        }
 }