Skip to content

Commit 773701a

Browse files
committed
internal/trace: pass GOTRACEBACK=crash to testprogs
The failures in #70310 are hard to decipher. The cases where the lock is being held either don't really make sense (the STW failures) or the goroutine that fails is 'running on another thread' and we don't get a stack trace. In fact, such a goroutine exists even in the STW cases. Since reproducing this is going to be hard (very few failures over a 2 year span) let's set GOTRACEBACK=crash for these testprogs so next time it happens we can see why. For #70310. Change-Id: I81a780aa82b173d42973f06911cb243f33352be1 Reviewed-on: https://go-review.googlesource.com/c/go/+/680476 Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Carlos Amedee <carlos@golang.org>
1 parent fb0c27c commit 773701a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/internal/trace/trace_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,10 @@ func testTraceProg(t *testing.T, progName string, extra func(t *testing.T, trace
600600
godebug += "," + extraGODEBUG
601601
}
602602
cmd.Env = append(cmd.Env, "GODEBUG="+godebug)
603+
if _, ok := os.LookupEnv("GOTRACEBACK"); !ok {
604+
// Unless overriden, set GOTRACEBACK=crash.
605+
cmd.Env = append(cmd.Env, "GOTRACEBACK=crash")
606+
}
603607

604608
// Capture stdout and stderr.
605609
//

0 commit comments

Comments
 (0)