RFR: 8294402: Add diagnostic logging to VMProps.checkDockerSupport [v2]

Mikhailo Seledtsov mseledtsov at openjdk.org
Wed Feb 1 02:31:52 UTC 2023


On Tue, 31 Jan 2023 04:35:30 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Files containing redirected stdout and stderr will be in the jtreg working directory, usually JTwork/scratch/.
>> I tried to keep the code as simple as possible, and found that redirecting the output of a child process to a file is the simplest option. Capturing child process output might involve quite a bit of code, pumping/draining the output to a buffer then printing the buffer out to the main logging method. E.g. see OutputAnalyzer.
>> 
>> Also note that we can not simply use test utils library such as output analyzer. Every depended non-core library has to be declared in TEST.ROOT as:
>> requires.extraPropDefns.libs = \
>>     ../../lib/jdk/test/lib/Platform.java \
>>     ../../lib/jdk/test/lib/Container.java
>> 
>> I tried to add OutputAnalyzer here, but it does require lot's of dependencies and the list grew large.
>> 
>> Let me know if I should do this anyway even if it adds more code to vmprops.
>
> Granted creating the file is much simpler than capturing the child process output directly, but can we not read the file back in and then include it in the main log? I'm assuming the output of container-ps is going to be quite small. We could also choose to include it only if there appears to have been an error.
> Though we could always expand on this later if the current simple approach doesn't suffice.

Reading the file back into the main output sounds reasonable. Will update the code and retest.

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

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


More information about the hotspot-dev mailing list