aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2023-11-01 11:55:10 -0400
committerCarlos Amedee <carlos@golang.org>2023-12-08 18:47:53 +0000
commit8cb86b5f85ce695cba8cb54fd9780d39d9de924d (patch)
tree59ba062c450f6f71bac520c1489281defb8ab560
parent59ffd3b90d0ead2dc36f855f13bb37717d96dc2d (diff)
downloadgo-8cb86b5f85ce695cba8cb54fd9780d39d9de924d.tar.gz
go-8cb86b5f85ce695cba8cb54fd9780d39d9de924d.zip
[release-branch.go1.20] os/signal: skip nohup tests on darwin builders
The new LUCI builders have a temporary limitation that breaks nohup. Skip nohup tests there. For #63875. Fixes #63910. Cq-Include-Trybots: luci.golang.try:go1.20-darwin-amd64_13 Change-Id: Ia9ffecea7310f84a21f6138d8f8cdfc5e1392307 Reviewed-on: https://go-review.googlesource.com/c/go/+/538698 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Bryan Mills <bcmills@google.com> (cherry picked from commit a334c452731e7becc2dc879e253c7198202af126) Reviewed-on: https://go-review.googlesource.com/c/go/+/546376 TryBot-Bypass: Carlos Amedee <carlos@golang.org>
-rw-r--r--src/os/signal/signal_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/os/signal/signal_test.go b/src/os/signal/signal_test.go
index dcfd08f78d..61a98c1ae2 100644
--- a/src/os/signal/signal_test.go
+++ b/src/os/signal/signal_test.go
@@ -308,6 +308,7 @@ func TestDetectNohup(t *testing.T) {
t.Errorf("ran test with -check_sighup_ignored and it succeeded: expected failure.\nOutput:\n%s", out)
}
Stop(c)
+
// Again, this time with nohup, assuming we can find it.
_, err := os.Stat("/usr/bin/nohup")
if err != nil {
@@ -320,6 +321,13 @@ func TestDetectNohup(t *testing.T) {
data, _ := os.ReadFile("nohup.out")
os.Remove("nohup.out")
if err != nil {
+ // nohup doesn't work on new LUCI darwin builders due to the
+ // type of launchd service the test run under. See
+ // https://go.dev/issue/63875.
+ if runtime.GOOS == "darwin" && strings.Contains(string(out), "nohup: can't detach from console: Inappropriate ioctl for device") {
+ t.Skip("Skipping nohup test due to darwin builder limitation. See https://go.dev/issue/63875.")
+ }
+
t.Errorf("ran test with -check_sighup_ignored under nohup and it failed: expected success.\nError: %v\nOutput:\n%s%s", err, out, data)
}
}
@@ -498,6 +506,16 @@ func TestNohup(t *testing.T) {
out, err := testenv.Command(t, "nohup", args...).CombinedOutput()
if err != nil {
+ // nohup doesn't work on new LUCI darwin builders due to the
+ // type of launchd service the test run under. See
+ // https://go.dev/issue/63875.
+ if runtime.GOOS == "darwin" && strings.Contains(string(out), "nohup: can't detach from console: Inappropriate ioctl for device") {
+ // TODO(go.dev/issue/63799): A false-positive in vet reports a
+ // t.Skip here as invalid. Switch back to t.Skip once fixed.
+ t.Logf("Skipping nohup test due to darwin builder limitation. See https://go.dev/issue/63875.")
+ return
+ }
+
t.Errorf("ran test with -send_uncaught_sighup=%d under nohup and it failed: expected success.\nError: %v\nOutput:\n%s", i, err, out)
} else {
t.Logf("ran test with -send_uncaught_sighup=%d under nohup.\nOutput:\n%s", i, out)