On Fri, 24 Nov 2023 10:34:02 GMT, Stefan Karlsson <stef...@openjdk.org> wrote:

> Tests using ProcessTools.executeProcess gets the following output written to 
> stdout:
> [2023-11-24T09:58:16.797540608Z] Gathering output for process 2517117
> [2023-11-24T09:58:23.070781345Z] Waiting for completion for process 2517117
> [2023-11-24T09:58:23.071045055Z] Waiting for completion finished for process 
> 2517117
> 
> This might be good for some use cases and debugging, but some tests spawns a 
> large number of processes and for those this output fills up the log files.
> 
> I propose that we add a way to turn of this output for tests where we find 
> this output to be too noisy.

Hello Stefan,

> The test were I want to use this is a long-running stress test that is known 
> to be good at shaking out JVM hangs. It has been written to provide its own 
> output about spawned processes and what they are doing, and have that info 
> written to appropriate files. For me, the OutputAnalyzer logging just adds 
> redundant output to the streams where I don't want the information.

Thank you for that context. What you are then proposing is for a way to reuse 
this utility class in specific tests, like the one you are working on, without 
needing the progress logs. So the idea isn't really to use this new API in all 
newly developed tests which use this `ProcessTools` library. Plus the 
implementation in this PR, retains the existing behaviour of logging the 
progress by default, which is a good thing.

Given that context, I don't have any objection in introducing this enhancemnet. 
During future reviews, I think, it wouldn't be too difficult to catch misuses 
of this new API in newer tests where the progress logs shouldn't be disabled.

As for whether this "config" should be externalized - I think it shouldn't be, 
since whether or not the progress logs will be excessive and too distracting 
(and thus need to be disabled) would be known at test development time itself.

The copyright year on `OutputBuffer.java` will need an update.

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

PR Comment: https://git.openjdk.org/jdk/pull/16807#issuecomment-1833660673
PR Comment: https://git.openjdk.org/jdk/pull/16807#issuecomment-1833664072

Reply via email to