diff --git a/src/runtime/lockrank_test.go b/src/runtime/lockrank_test.go index a7b1b8df7cd..dd99eb4565a 100644 --- a/src/runtime/lockrank_test.go +++ b/src/runtime/lockrank_test.go @@ -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 {