Skip to content

Commit fcb75c8

Browse files
Bryan C. Millsgopherbot
Bryan C. Mills
authored andcommitted
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 <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Auto-Submit: Bryan Mills <[email protected]> Run-TryBot: Bryan Mills <[email protected]>
1 parent a9d4b2d commit fcb75c8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/runtime/lockrank_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@ import (
1515
// Test that the generated code for the lock rank graph is up-to-date.
1616
func TestLockRankGenerated(t *testing.T) {
1717
testenv.MustHaveGoRun(t)
18-
want, err := testenv.CleanCmdEnv(exec.Command(testenv.GoToolPath(t), "run", "mklockrank.go")).CombinedOutput()
18+
cmd := testenv.CleanCmdEnv(testenv.Command(t, testenv.GoToolPath(t), "run", "mklockrank.go"))
19+
want, err := cmd.Output()
1920
if err != nil {
20-
t.Fatal(err)
21+
if ee, ok := err.(*exec.ExitError); ok && len(ee.Stderr) > 0 {
22+
t.Fatalf("%v: %v\n%s", cmd, err, ee.Stderr)
23+
}
24+
t.Fatalf("%v: %v", cmd, err)
2125
}
2226
got, err := os.ReadFile("lockrank.go")
2327
if err != nil {

0 commit comments

Comments
 (0)