Skip to content

Commit

Permalink
improve ControlMaster error reporting (gravitational#30631)
Browse files Browse the repository at this point in the history
  • Loading branch information
fspmarshall authored Aug 18, 2023
1 parent d5c27ea commit 37e18d9
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4463,15 +4463,12 @@ func testExternalClient(t *testing.T, suite *integrationTestSuite) {
if tt.outError {
require.Error(t, err)
} else {
if err != nil {
// If an *exec.ExitError is returned, parse it and return stderr. If this
// is not done then c.Assert will just print a byte array for the error.
er, ok := err.(*exec.ExitError)
if ok {
t.Fatalf("Unexpected error: %v", string(er.Stderr))
}
// ensure stderr is printed as a string rather than bytes
var stderr string
if e, ok := err.(*exec.ExitError); ok {
stderr = string(e.Stderr)
}
require.NoError(t, err)
require.NoError(t, err, "stderr=%q", stderr)
require.Equal(t, tt.outExecOutput, strings.TrimSpace(string(output)))
}
})
Expand Down

0 comments on commit 37e18d9

Please sign in to comment.