]> Cypherpunks repositories - gostls13.git/commit
runtime: ensure no GC is running in TestParallelRWMutexReaders
authorMichael Anthony Knyszek <mknyszek@google.com>
Tue, 23 Nov 2021 14:30:56 +0000 (14:30 +0000)
committerMichael Knyszek <mknyszek@google.com>
Tue, 23 Nov 2021 16:00:03 +0000 (16:00 +0000)
commit066620f0d8597116a62d9423669ca569646de5ff
treec11260074139f826b422ed360f6162a2d5fa8db4
parent83bfed916b97d51646b4bdc95e0e0fd7798b754f
runtime: ensure no GC is running in TestParallelRWMutexReaders

Currently this test makes it clear that it's unsafe for a GC to run,
otherwise a deadlock could occur, so it calls SetGCPercent(-1). However,
a GC may be actively in progress, and SetGCPercent is not going to end
any in-progress GC. Call runtime.GC to block until at least the current
GC is over.

Updates #49680.

Change-Id: Ibdc7d378e8cf7e05270910e92effcad8c6874e59
Reviewed-on: https://go-review.googlesource.com/c/go/+/366534
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/runtime/rwmutex_test.go