aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/export_test.go
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2022-01-21 16:52:56 -0500
committerMichael Pratt <mpratt@google.com>2022-01-24 17:50:23 +0000
commit97e740e8b0ff1b32b164b0cbef06c12c4d591f3f (patch)
tree814996eb13709d40396681b3d93a3bb98910d058 /src/runtime/export_test.go
parentf88c3b9f4d087895c3eab5ac4dd8459c76d0d0d8 (diff)
downloadgo-97e740e8b0ff1b32b164b0cbef06c12c4d591f3f.tar.gz
go-97e740e8b0ff1b32b164b0cbef06c12c4d591f3f.zip
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>
Diffstat (limited to 'src/runtime/export_test.go')
-rw-r--r--src/runtime/export_test.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/runtime/export_test.go b/src/runtime/export_test.go
index 3c8f9eb49b..0f21838721 100644
--- a/src/runtime/export_test.go
+++ b/src/runtime/export_test.go
@@ -1328,3 +1328,5 @@ func Acquirem() {
func Releasem() {
releasem(getg().m)
}
+
+var Timediv = timediv