Commit aec62891 authored by Steven Allen's avatar Steven Allen

test: fix gc test on go 1.16

No idea why we need this, but go 1.16 doesn't always completely GC the
first round.
parent 4016316b
......@@ -82,6 +82,8 @@ func TestPool(t *testing.T) {
debug.SetGCPercent(100) // to allow following GC to actually run
runtime.GC()
// For some reason, you need to run GC twice on go 1.16 if you want it to reliably work.
runtime.GC()
if g := p.Get(10); &g[0] == &a[0] {
t.Fatalf("got a; want new slice after GC")
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment