diff options
| author | Keith Randall <khr@golang.org> | 2014-07-30 11:02:40 -0700 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2014-07-30 11:02:40 -0700 |
| commit | 1329d044cf57520704a7a09281a901147abf84cc (patch) | |
| tree | 52872f6ab05886dcbdd26c52347f3fe0b863c6aa /src/pkg/runtime | |
| parent | aff7883d9a7af1dc89a2c51e06ddfcd3d9f80090 (diff) | |
| download | go-1329d044cf57520704a7a09281a901147abf84cc.tar.xz | |
runtime: fix stack memory test
Stand-alone this test is fine. Run together with
others, however, the stack used can actually go
negative because other tests are freeing stack
during its execution.
This behavior is new with the new stack allocator.
The old allocator never returned (min-sized) stacks.
This test is fairly poor - it needs to run in
isolation to be accurate. Maybe we should delete it.
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/119330044
Diffstat (limited to 'src/pkg/runtime')
| -rw-r--r-- | src/pkg/runtime/stack_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/runtime/stack_test.go b/src/pkg/runtime/stack_test.go index 424a15b3e5..08282afd42 100644 --- a/src/pkg/runtime/stack_test.go +++ b/src/pkg/runtime/stack_test.go @@ -106,9 +106,9 @@ func TestStackMem(t *testing.T) { } s1 := new(MemStats) ReadMemStats(s1) - consumed := s1.StackSys - s0.StackSys + consumed := int64(s1.StackSys - s0.StackSys) t.Logf("Consumed %vMB for stack mem", consumed>>20) - estimate := uint64(8 * BatchSize * ArraySize * RecursionDepth) // 8 is to reduce flakiness. + estimate := int64(8 * BatchSize * ArraySize * RecursionDepth) // 8 is to reduce flakiness. if consumed > estimate { t.Fatalf("Stack mem: want %v, got %v", estimate, consumed) } |
