Skip to content

Commit 3ee782b

Browse files
author
Bryan C. Mills
committed
os/signal: rework test timeouts and concurrency
Use a uniform function (named “quiesce”) to wait for possible signals in a way that gives the kernel many opportunities to deliver them. Simplify channel usage and concurrency in stress tests. Use (*testing.T).Deadline instead of parsing the deadline in TestMain. In TestStop, sleep forever in a loop if we expect the test to die from a signal. That should reduce the flakiness of TestNohup, since TestStop will no longer spuriously pass when run as a subprocess of TestNohup. Since independent signals should not interfere, run the different signals in TestStop in parallel when testing in short mode. Since TestNohup runs TestStop as a subprocess, and TestStop needs to wait many times for signals to quiesce, run its test subprocesses concurrently and in short mode — reducing the latency of that test by more than a factor of 2. The above two changes reduce the running time of TestNohup on my workstation to ~345ms, making it possible to run much larger counts of the test in the same amount of wall time. If the test remains flaky after this CL, we can spend all or part of that latency improvement on a longer settle time. Updates #33174 Change-Id: I09206f213d8c1888b50bf974f965221a5d482419 Reviewed-on: https://go-review.googlesource.com/c/go/+/226138 Run-TryBot: Bryan C. Mills <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 33b648c commit 3ee782b

File tree

1 file changed

+212
-147
lines changed

1 file changed

+212
-147
lines changed

0 commit comments

Comments
 (0)