Skip to content

Commit 98a0311

Browse files
prattmicgopherbot
authored andcommitted
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>
1 parent 6bb4299 commit 98a0311

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/runtime/vdso_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func TestUsingVDSO(t *testing.T) {
6262
t.Logf("%s", out)
6363
}
6464
if err != nil {
65-
if err := err.(*exec.ExitError); err != nil && err.Sys().(syscall.WaitStatus).Signaled() {
65+
if err, ok := err.(*exec.ExitError); ok && err.Sys().(syscall.WaitStatus).Signaled() {
6666
if !bytes.Contains(out, []byte("+++ killed by")) {
6767
// strace itself occasionally crashes.
6868
// Here, it exited with a signal, but

0 commit comments

Comments
 (0)