Skip to content

Commit

Permalink
8238710: LingeredApp doesn't log stdout/stderr if exits with non-zero…
Browse files Browse the repository at this point in the history
… code

Reviewed-by: cjplummer, sspitsyn
  • Loading branch information
Alex Menkov committed Feb 13, 2020
1 parent b72e31b commit bcb804f
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions test/lib/jdk/test/lib/apps/LingeredApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,15 @@ public void runApp(String[] vmArguments)
}

private void finishApp() {
OutputBuffer output = getOutput();
String msg =
" LingeredApp stdout: [" + output.getStdout() + "];\n" +
" LingeredApp stderr: [" + output.getStderr() + "]\n" +
" LingeredApp exitValue = " + appProcess.exitValue();
if (appProcess != null) {
OutputBuffer output = getOutput();
String msg =
" LingeredApp stdout: [" + output.getStdout() + "];\n" +
" LingeredApp stderr: [" + output.getStderr() + "]\n" +
" LingeredApp exitValue = " + appProcess.exitValue();

System.err.println(msg);
System.err.println(msg);
}
}

/**
Expand All @@ -377,12 +379,14 @@ public void stopApp() throws IOException {
// an exception before the LA actually starts
if (appProcess != null) {
waitAppTerminate();

finishApp();

int exitcode = appProcess.exitValue();
if (exitcode != 0) {
throw new IOException("LingeredApp terminated with non-zero exit code " + exitcode);
}
}
finishApp();
}

/**
Expand Down

0 comments on commit bcb804f

Please sign in to comment.