Skip to content

Commit

Permalink
Merge pull request #18 from libp2p/test/fix-gc-test
Browse files Browse the repository at this point in the history
test: fix gc test on go 1.16
  • Loading branch information
Stebalien authored May 10, 2021
2 parents 1a02bce + aec6289 commit ccf95b0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit ccf95b0

Please sign in to comment.