-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Description
With rr, I can run a process while generating a trace of its execution, and then replay that trace later and step forwards and backwards through it. Beyond being able to step backwards through a debug session, this also means I could run tests in CI using rr, and then download those traces and step through them on my local machine. This would be extremely valuable to me for debugging transient and hard to reproduce failures that sometimes only occur in CI.
I propose adding support to go test for running tests with rr, for example a boolean -rr flag that would wrap the test binary execution with rr record "$@", and an -rrflags flag to pass additional flags to rr. I believe go test is effectively executing exec.Command(testBinary, args...).Run() at some point so this could be implemented simply by modifying that to exec.Command("rr", "record", rrFlags..., testBinary, args...).Run() (this is pseudocode, for brevity).