From: Michael Pratt Date: Wed, 23 Jul 2025 20:56:50 +0000 (-0400) Subject: runtime: check TestUsingVDSO ExitError type assertion X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=98a031193b93d7b0e8353810351c9544250e7bcd;p=gostls13.git 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 LUCI-TryBot-Result: Go LUCI Reviewed-by: Keith Randall Auto-Submit: Michael Pratt --- diff --git a/src/runtime/vdso_test.go b/src/runtime/vdso_test.go index b0f5fbe728..cb70a040d6 100644 --- a/src/runtime/vdso_test.go +++ b/src/runtime/vdso_test.go @@ -62,7 +62,7 @@ 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 err, ok := err.(*exec.ExitError); ok && err.Sys().(syscall.WaitStatus).Signaled() { if !bytes.Contains(out, []byte("+++ killed by")) { // strace itself occasionally crashes. // Here, it exited with a signal, but