On Thu, 18 Mar 2021 13:41:01 GMT, Roger Riggs <rri...@openjdk.org> wrote:
> The test expects there to be zero output from the child (and it doesn't > matter what state the child is in). > Can the logging from the VM be disabled or re-directed? Not to the extend that it would be guaranteed never to happen. Even if we control all output in the hotspot, there are other libraries. E.g. glibc writes a lengthy report to stderr in case of a heap corruption, which I believe does not result in a hs-err file. One simple solution, simpler than using two threads, could be to use ProcessBuilder::redirectError(Redirect.INHERIT) if reading stdout resp. ProcessBuilder::redirectOutput(Redirect.INHERIT) if reading stderr. One line, takes care of the stream you don't read does not block, and, we can see the child output in the parent stdout/err. ------------- PR: https://git.openjdk.java.net/jdk/pull/3049