The solution proposed by Stefan K The startProcess() might wait forever for the expected line if the process exits (failed to start). It makes sense to just fail earlier in such cases.
The fix also move 'output = new OutputAnalyzer(this.process);' in method xrun() to be able to try to print them in waitFor is failed/interrupted. ------------- Commit messages: - 8303133: Update ProcessTols.startProcess(...) to exit early if process exit before linePredicate is printed. Changes: https://git.openjdk.org/jdk/pull/12751/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12751&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8303133 Stats: 26 lines in 2 files changed: 16 ins; 3 del; 7 mod Patch: https://git.openjdk.org/jdk/pull/12751.diff Fetch: git fetch https://git.openjdk.org/jdk pull/12751/head:pull/12751 PR: https://git.openjdk.org/jdk/pull/12751
