Skip to content
Permalink
Browse files
8238710: LingeredApp doesn't log stdout/stderr if exits with non-zero…
… code

Backport-of: bcb804f
  • Loading branch information
Larry-N authored and Yuri Nesterenko committed Feb 3, 2021
1 parent 6778089 commit e2fbd2698e465d9c4eba6c77307ade114d4a28c7
Showing with 11 additions and 7 deletions.
  1. +11 −7 test/lib/jdk/test/lib/apps/LingeredApp.java
@@ -360,13 +360,15 @@ public void runApp(List<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);
}
}

/**
@@ -380,12 +382,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();
}

/**

1 comment on commit e2fbd26

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on e2fbd26 Feb 3, 2021

Please sign in to comment.