Skip to content

Commit 379a49c

Browse files
Bryan C. Millsgopherbot
Bryan C. Mills
authored andcommitted
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 <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Bryan Mills <[email protected]> Auto-Submit: Bryan Mills <[email protected]>
1 parent 9fe17a0 commit 379a49c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/os/exec/exec_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"path/filepath"
2828
"reflect"
2929
"runtime"
30+
"runtime/debug"
3031
"strconv"
3132
"strings"
3233
"sync"
@@ -988,6 +989,7 @@ func TestContextCancel(t *testing.T) {
988989
if time.Since(start) > time.Minute {
989990
// Panic instead of calling t.Fatal so that we get a goroutine dump.
990991
// We want to know exactly what the os/exec goroutines got stuck on.
992+
debug.SetTraceback("system")
991993
panic("canceling context did not stop program")
992994
}
993995

0 commit comments

Comments
 (0)