Skip to content
Permalink
Browse files

8238710: LingeredApp doesn't log stdout/stderr if exits with non-zero…

… code

Reviewed-by: cjplummer, sspitsyn
  • Loading branch information
Alex Menkov
Alex Menkov committed Feb 13, 2020
1 parent b72e31b commit bcb804f07f290e70fe0e2a243f98aec7a3ec0497
Showing with 11 additions and 7 deletions.
  1. +11 −7 test/lib/jdk/test/lib/apps/LingeredApp.java
@@ -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);
}
}

/**
@@ -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();
}

/**

0 comments on commit bcb804f

Please sign in to comment.