runtime: check TestUsingVDSO ExitError type assertion

Currently this test panics if the error is not an ExitError. We aren't
expecting other errors, but we want to continue to the t.Fatal so the
error contents actually get logged.

For #74672.

Change-Id: I6a6a636cee5ddac500ed7ec549340b02944101ab
Reviewed-on: https://go-review.googlesource.com/c/go/+/689956
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Michael Pratt <mpratt@google.com>
This commit is contained in:
Michael Pratt 2025-07-23 16:56:50 -04:00 committed by Gopher Robot
parent 6bb42997c8
commit 98a031193b

View file

@ -62,7 +62,7 @@ func TestUsingVDSO(t *testing.T) {
t.Logf("%s", out) t.Logf("%s", out)
} }
if err != nil { if err != nil {
if err := err.(*exec.ExitError); err != nil && err.Sys().(syscall.WaitStatus).Signaled() { if err, ok := err.(*exec.ExitError); ok && err.Sys().(syscall.WaitStatus).Signaled() {
if !bytes.Contains(out, []byte("+++ killed by")) { if !bytes.Contains(out, []byte("+++ killed by")) {
// strace itself occasionally crashes. // strace itself occasionally crashes.
// Here, it exited with a signal, but // Here, it exited with a signal, but