]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: temporary weaken a check in test
authorDmitriy Vyukov <dvyukov@google.com>
Wed, 12 Mar 2014 06:20:58 +0000 (10:20 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Wed, 12 Mar 2014 06:20:58 +0000 (10:20 +0400)
Currently the test fails as:
$ go test -v -cpu 1,1,1,1 runtime -test.run=TestStack
stack_test.go:1584: Stack inuse: want 4194304, got 18446744073709547520

Update #7468

LGTM=rsc
R=golang-codereviews, bradfitz
CC=golang-codereviews, khr, rsc
https://golang.org/cl/74010043

src/pkg/runtime/stack_test.go

index 00c2d0e061d5655994e1376a09fbff68e3dc243d..b084ddddb517e347c51575ea2b75cff11506c5d2 100644 (file)
@@ -1576,7 +1576,9 @@ func TestStackMem(t *testing.T) {
        if consumed > estimate {
                t.Fatalf("Stack mem: want %v, got %v", estimate, consumed)
        }
-       inuse := s1.StackInuse - s0.StackInuse
+       // Due to broken stack memory accounting (http://golang.org/issue/7468),
+       // StackInuse can decrease during function execution, so we cast the values to int64.
+       inuse := int64(s1.StackInuse) - int64(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)