Skip to content

Commit 535eb7f

Browse files
Bryan C. Millsromaindoumenc
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 golang#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>
1 parent 4c6b210 commit 535eb7f

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)