From: Bryan C. Mills Date: Wed, 12 Oct 2022 15:15:45 +0000 (-0400) Subject: os/exec: set traceback to "system" in TestContextCancel X-Git-Tag: go1.20rc1~648 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=379a49c593ce3c2e8e57039e05e90aa466363092;p=gostls13.git 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 TryBot-Result: Gopher Robot Run-TryBot: Bryan Mills Auto-Submit: Bryan Mills --- 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") }