aboutsummaryrefslogtreecommitdiff
path: root/src/internal/trace/trace_test.go
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2025-06-09 22:54:54 +0000
committerMichael Knyszek <mknyszek@google.com>2025-06-10 11:31:20 -0700
commit773701a853a3105696c59c2b92b2eff35e0e055b (patch)
tree3810e07e6f0d05ccb80d7251f30bd402ab396718 /src/internal/trace/trace_test.go
parentfb0c27c514b7d6bbb88b72cfd7baff01e567f6bb (diff)
downloadgo-773701a853a3105696c59c2b92b2eff35e0e055b.tar.xz
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>
Diffstat (limited to 'src/internal/trace/trace_test.go')
-rw-r--r--src/internal/trace/trace_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/internal/trace/trace_test.go b/src/internal/trace/trace_test.go
index 0aa297d762..7eb50d0f4e 100644
--- a/src/internal/trace/trace_test.go
+++ b/src/internal/trace/trace_test.go
@@ -600,6 +600,10 @@ func testTraceProg(t *testing.T, progName string, extra func(t *testing.T, trace
godebug += "," + extraGODEBUG
}
cmd.Env = append(cmd.Env, "GODEBUG="+godebug)
+ if _, ok := os.LookupEnv("GOTRACEBACK"); !ok {
+ // Unless overriden, set GOTRACEBACK=crash.
+ cmd.Env = append(cmd.Env, "GOTRACEBACK=crash")
+ }
// Capture stdout and stderr.
//