From aa3413cd98b6e11fe0d37d3d2a489a9cd83b47ad Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Wed, 15 Apr 2020 10:56:22 -0400 Subject: [PATCH] os/signal: special-case test settle time on the solaris-amd64-oraclerel builder This is an attempt to distinguish between a dropped signal and general builder slowness. The previous attempt (increasing the settle time to 250ms) still resulted in a timeout: https://build.golang.org/log/dd62939f6d3b512fe3e6147074a9c6db1144113f For #33174 Change-Id: I79027e91ba651f9f889985975f38c7b01d82f634 Reviewed-on: https://go-review.googlesource.com/c/go/+/228266 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/os/signal/signal_test.go | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/os/signal/signal_test.go b/src/os/signal/signal_test.go index 50e21d4e643a6b..f0e06b879504ce 100644 --- a/src/os/signal/signal_test.go +++ b/src/os/signal/signal_test.go @@ -27,10 +27,25 @@ import ( // on heavily loaded systems. // // The current value is set based on flakes observed in the Go builders. -var settleTime = 250 * time.Millisecond +var settleTime = 100 * time.Millisecond func init() { - if s := os.Getenv("GO_TEST_TIMEOUT_SCALE"); s != "" { + if testenv.Builder() == "solaris-amd64-oraclerel" { + // The solaris-amd64-oraclerel builder has been observed to time out in + // TestNohup even with a 250ms settle time. + // + // Use a much longer settle time on that builder to try to suss out whether + // the test is flaky due to builder slowness (which may mean we need a + // longer GO_TEST_TIMEOUT_SCALE) or due to a dropped signal (which may + // instead need a test-skip and upstream bug filed against the Solaris + // kernel). + // + // This constant is chosen so as to make the test as generous as possible + // while still reliably completing within 3 minutes in non-short mode. + // + // See https://golang.org/issue/33174. + settleTime = 11 * time.Second + } else if s := os.Getenv("GO_TEST_TIMEOUT_SCALE"); s != "" { if scale, err := strconv.Atoi(s); err == nil { settleTime *= time.Duration(scale) }