mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: deflake TestGCTestIsReachable
This is a simple workaround for a bug where runtime.GC() can return before finishing a full sweep, causing gcTestIsReachable to throw. The right thing is to fix runtime.GC(), but this should get this test passing reliably in the meantime. Updates #45315. Change-Id: Iae141e6dbb26a9c2649497c1feedd4aaeaf540c7 Reviewed-on: https://go-review.googlesource.com/c/go/+/307809 Trust: Austin Clements <austin@google.com> Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
parent
1271e9a9cc
commit
bcc4422ee1
1 changed files with 5 additions and 0 deletions
|
|
@ -2391,6 +2391,11 @@ func gcTestIsReachable(ptrs ...unsafe.Pointer) (mask uint64) {
|
||||||
// Force a full GC and sweep.
|
// Force a full GC and sweep.
|
||||||
GC()
|
GC()
|
||||||
|
|
||||||
|
// TODO(austin): Work around issue #45315. One GC() can return
|
||||||
|
// without finishing the sweep. Do a second to force the sweep
|
||||||
|
// through.
|
||||||
|
GC()
|
||||||
|
|
||||||
// Process specials.
|
// Process specials.
|
||||||
for i, s := range specials {
|
for i, s := range specials {
|
||||||
if !s.done {
|
if !s.done {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue