]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: skip test if strace crashes
authorAustin Clements <austin@google.com>
Wed, 17 Jan 2024 19:24:06 +0000 (14:24 -0500)
committerGopher Robot <gobot@golang.org>
Wed, 17 Jan 2024 19:47:47 +0000 (19:47 +0000)
Very occasionally, at least on linux/386, strace itself will crash in
TestUsingVDSO. Detect these crashes and just skip the test.

Fixes #63734.

Change-Id: I050494459d47dd96c0b8dc0b16353cb532fba93e
Reviewed-on: https://go-review.googlesource.com/c/go/+/556357
Auto-Submit: Austin Clements <austin@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/runtime/vdso_test.go

index 126fd8d199ec801f2f7de1fcac9ceb7887d9b84a..d025ba50c212acaab35037916c28c8fd9a8d7ff1 100644 (file)
@@ -12,6 +12,7 @@ import (
        "os"
        "os/exec"
        "path/filepath"
+       "syscall"
        "testing"
        "time"
 )
@@ -56,6 +57,16 @@ func TestUsingVDSO(t *testing.T) {
                t.Logf("%s", out)
        }
        if err != nil {
+               if err := err.(*exec.ExitError); err != nil && err.Sys().(syscall.WaitStatus).Signaled() {
+                       if !bytes.Contains(out, []byte("+++ killed by")) {
+                               // strace itself occasionally crashes.
+                               // Here, it exited with a signal, but
+                               // the strace log didn't report any
+                               // signal from the child process.
+                               t.Log(err)
+                               testenv.SkipFlaky(t, 63734)
+                       }
+               }
                t.Fatal(err)
        }