From 7d34aff8f12280af33d98a7dbe2639a7adb7d9a1 Mon Sep 17 00:00:00 2001 From: Raul Silvera Date: Thu, 17 Jan 2019 13:47:53 -0800 Subject: [PATCH] Force heap sampling on memprof test program for determinism --- src/runtime/testdata/testprog/memprof.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/runtime/testdata/testprog/memprof.go b/src/runtime/testdata/testprog/memprof.go index a22fee61d7..7c700af852 100644 --- a/src/runtime/testdata/testprog/memprof.go +++ b/src/runtime/testdata/testprog/memprof.go @@ -14,6 +14,8 @@ import ( ) func init() { + // Force heap sampling for determinism. + runtime.MemProfileRate = 1 register("MemProf", MemProf) }