aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/debug/garbage_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/debug/garbage_test.go')
-rw-r--r--src/runtime/debug/garbage_test.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/runtime/debug/garbage_test.go b/src/runtime/debug/garbage_test.go
index 37417aca2c..acc781ebdc 100644
--- a/src/runtime/debug/garbage_test.go
+++ b/src/runtime/debug/garbage_test.go
@@ -160,6 +160,8 @@ func TestSetGCPercent(t *testing.T) {
runtime.ReadMemStats(&ms)
ngc1 := ms.NumGC
SetGCPercent(10)
+ // It may require an allocation to actually force the GC.
+ setGCPercentSink = make([]byte, 1<<20)
runtime.ReadMemStats(&ms)
ngc2 := ms.NumGC
if ngc1 == ngc2 {