internal/gocore/test: split run into runCrasher and doRunCrasher

Refactors the run function by splitting it in two, making it easier to
reuse for more involved tests that need to set different parameters
(flags, other environment variables).

This commit also makes the otherwise unrelated change of setting
GOMAXPROCS=2 in the child binary. This can reduce the size of the crash
stack (fewer GC workers).

Change-Id: I4edd5c51fdfed6b8bb57f2e682cb98dc084e50a5
Reviewed-on: https://go-review.googlesource.com/c/debug/+/632296
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Nicolas Hillegeer <aktau@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
1 file changed
tree: 4f2d3d5d4b1c83403fa32c15cb6098aadb877423
  1. cmd/
  2. dwtest/
  3. internal/
  4. codereview.cfg
  5. CONTRIBUTING.md
  6. go.mod
  7. go.sum
  8. LICENSE
  9. README.md
README.md

Go Debug

Go Reference

This repository holds utilities and libraries for debugging Go programs.

WARNING! Please expect breaking changes and unstable APIs. Most of them are currently are at an early, experimental stage.

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://go.dev/doc/contribute.

The git repository is https://go.googlesource.com/debug.

The main issue tracker for the debug repository is located at https://go.dev/issues. Prefix your issue with “x/debug:” in the subject line, so it is easy to find.