diff --git a/pool_test.go b/pool_test.go index 7421bd5852a25c017ecc68c023857b870de8e545..4b5ff7a20a2a3d1a14e1c2663508debc3fb21638 100644 --- a/pool_test.go +++ b/pool_test.go @@ -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") }