1
0
mirror of https://github.com/golang/go synced 2024-11-18 22:44:48 -07:00

runtime: log stderr in TestLockRankGenerated on failure

For #62334.

Change-Id: I6d93dacc914590ef9c5a034dd4633466ec0bde8d
Reviewed-on: https://go-review.googlesource.com/c/go/+/524056
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
This commit is contained in:
Bryan C. Mills 2023-08-29 12:15:23 -04:00 committed by Gopher Robot
parent a9d4b2dbe4
commit fcb75c8695

View File

@ -15,9 +15,13 @@ import (
// Test that the generated code for the lock rank graph is up-to-date.
func TestLockRankGenerated(t *testing.T) {
testenv.MustHaveGoRun(t)
want, err := testenv.CleanCmdEnv(exec.Command(testenv.GoToolPath(t), "run", "mklockrank.go")).CombinedOutput()
cmd := testenv.CleanCmdEnv(testenv.Command(t, testenv.GoToolPath(t), "run", "mklockrank.go"))
want, err := cmd.Output()
if err != nil {
t.Fatal(err)
if ee, ok := err.(*exec.ExitError); ok && len(ee.Stderr) > 0 {
t.Fatalf("%v: %v\n%s", cmd, err, ee.Stderr)
}
t.Fatalf("%v: %v", cmd, err)
}
got, err := os.ReadFile("lockrank.go")
if err != nil {