aboutsummaryrefslogtreecommitdiff
path: root/src/os/exec/exec_test.go
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2022-10-12 11:15:45 -0400
committerGopher Robot <gobot@golang.org>2022-10-13 20:12:51 +0000
commit379a49c593ce3c2e8e57039e05e90aa466363092 (patch)
treea7f84213f073dae4019f29647a2373245110fd2a /src/os/exec/exec_test.go
parent9fe17a0340b1609355aa5ce1828a0cf39e0a8092 (diff)
downloadgo-379a49c593ce3c2e8e57039e05e90aa466363092.tar.xz
os/exec: set traceback to "system" in TestContextCancel
This will dump more goroutines if the test happens to fail. For #50138. Change-Id: Ifae30b5ba8bddcdaa9250dd90be8d8ba7d5604d2 Reviewed-on: https://go-review.googlesource.com/c/go/+/442476 Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'src/os/exec/exec_test.go')
-rw-r--r--src/os/exec/exec_test.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/os/exec/exec_test.go b/src/os/exec/exec_test.go
index d79befa19a..f38ce4e72c 100644
--- a/src/os/exec/exec_test.go
+++ b/src/os/exec/exec_test.go
@@ -27,6 +27,7 @@ import (
"path/filepath"
"reflect"
"runtime"
+ "runtime/debug"
"strconv"
"strings"
"sync"
@@ -988,6 +989,7 @@ func TestContextCancel(t *testing.T) {
if time.Since(start) > time.Minute {
// Panic instead of calling t.Fatal so that we get a goroutine dump.
// We want to know exactly what the os/exec goroutines got stuck on.
+ debug.SetTraceback("system")
panic("canceling context did not stop program")
}