RFR: 8233725: ProcessTools.startProcess() has output issues when using an OutputAnalyzer at the same time

Leonid Mesnik lmesnik at openjdk.org
Thu Apr 20 16:18:48 UTC 2023


ProcessTools.startProcess() creates process and read it's output error streams. So the any other using of corresponding Process.getInputStream() and Process.getErrorStream() doesn't get process streams.

This fix preserve process streams content and allow to read it after process completion. The another possible solution would be to throw exception when user tries to read already drained streams to fail tests earlier. However it complicates usage of ProcessTools.startProcess() methods.

The regression test has been provided with issue.

-------------

Commit messages:
 - 8233725: ProcessTools.startProcess() has output issues when using an OutputAnalyzer at the same time

Changes: https://git.openjdk.org/jdk/pull/13560/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=13560&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8233725
  Stats: 180 lines in 3 files changed: 163 ins; 2 del; 15 mod
  Patch: https://git.openjdk.org/jdk/pull/13560.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13560/head:pull/13560

PR: https://git.openjdk.org/jdk/pull/13560


More information about the serviceability-dev mailing list