mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: replace TestFutexsleep with TestTimediv
TestFutexsleep was originally created in CL 7876043 as a regression test for buggy division logic in futexsleep. Several months later CL 11575044 moved this logic to timediv (called by futexsleep). This test calls runtime.Futexsleep, which temporarily disables asynchronous preemption. Unfortunately, TestFutexSleep calls this from multiple goroutines, creating a race condition that may result in asynchronous preemption remaining disabled for the remainder of the process lifetime. We could fix this by moving the async preemption disable to the main test function, however this test has had a history of flakiness. As an alternative, this CL replaces the test wholesale with a new test for timediv, covering the overflow logic without the difficulty of dealing with futex. Fixes #50749. Change-Id: If9e1dac63ef1535adb49f9a9ffcaff99b9135895 Reviewed-on: https://go-review.googlesource.com/c/go/+/380058 Trust: Michael Pratt <mpratt@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
parent
f88c3b9f4d
commit
97e740e8b0
4 changed files with 78 additions and 106 deletions
|
|
@ -1328,3 +1328,5 @@ func Acquirem() {
|
|||
func Releasem() {
|
||||
releasem(getg().m)
|
||||
}
|
||||
|
||||
var Timediv = timediv
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue