]> Cypherpunks repositories - gostls13.git/commit
runtime: replace TestFutexsleep with TestTimediv
authorMichael Pratt <mpratt@google.com>
Fri, 21 Jan 2022 21:52:56 +0000 (16:52 -0500)
committerMichael Pratt <mpratt@google.com>
Mon, 24 Jan 2022 17:50:23 +0000 (17:50 +0000)
commit97e740e8b0ff1b32b164b0cbef06c12c4d591f3f
tree814996eb13709d40396681b3d93a3bb98910d058
parentf88c3b9f4d087895c3eab5ac4dd8459c76d0d0d8
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>
src/runtime/export_futex_test.go [deleted file]
src/runtime/export_test.go
src/runtime/futex_test.go [deleted file]
src/runtime/runtime_test.go