From 98a031193b93d7b0e8353810351c9544250e7bcd Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 23 Jul 2025 16:56:50 -0400 Subject: [PATCH] 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 --- src/runtime/vdso_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.51.0