Currently, the Executor class from the jpackage test lib [1] runs commands in a way that stdout and stderr streams are merged in uncontrolled order.
There is no way to access the contents of stdout and stderr streams individually. The class also doesn't offer an API to disable stderr or stdout individually.
Lack of flexibility causes workarounds. E.g.: BasicTest.testErrorsAlwaysPrinted() [2] would be cleaner if it were possible to analyze the contents of the stderr stream and ignore the contents of the stdout stream.
Rework the Executor class to allow control over stdout and stderr streams. Do not merge these streams in an uncontrolled order. If merged output is requested, it should consist of the contents of the stdout followed by the contents of the stderr stream.
[1] https://github.com/openjdk/jdk/blob/4eae9b5ba61bfe262b43346a7499c98c1a54d2fe/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/Executor.java
[2] https://github.com/openjdk/jdk/blob/7b0618859a7764b0d4c8b893a19dfb64f4351c07/test/jdk/tools/jpackage/share/BasicTest.java#L236
There is no way to access the contents of stdout and stderr streams individually. The class also doesn't offer an API to disable stderr or stdout individually.
Lack of flexibility causes workarounds. E.g.: BasicTest.testErrorsAlwaysPrinted() [2] would be cleaner if it were possible to analyze the contents of the stderr stream and ignore the contents of the stdout stream.
Rework the Executor class to allow control over stdout and stderr streams. Do not merge these streams in an uncontrolled order. If merged output is requested, it should consist of the contents of the stdout followed by the contents of the stderr stream.
[1] https://github.com/openjdk/jdk/blob/4eae9b5ba61bfe262b43346a7499c98c1a54d2fe/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/Executor.java
[2] https://github.com/openjdk/jdk/blob/7b0618859a7764b0d4c8b893a19dfb64f4351c07/test/jdk/tools/jpackage/share/BasicTest.java#L236
- is blocked by
-
JDK-8354985 Add unit tests for Executor class from jpackage test lib
-
- Resolved
-
- links to
-
Commit(master) openjdk/jdk/22e8a97a
-
Review(master) openjdk/jdk/24745