[crac] RFR: 8377562: [CRaC] Add better logging to RemoteJmxTest [v2]
Timofei Pushkin
tpushkin at openjdk.org
Fri Feb 20 09:54:46 UTC 2026
On Tue, 10 Feb 2026 18:00:50 GMT, Radim Vansa <rvansa at openjdk.org> wrote:
>> Timofei Pushkin has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision:
>>
>> - Ensure resources live long enough in some tests
>> - Merge remote-tracking branch 'openjdk-crac/crac' into remote-jmx-test
>> - Always capture output
>> - Improve process synchronization in ImageScoreTest
>> - Make timed waiting more robust
>> - Merge remote-tracking branch 'openjdk-crac/crac' into remote-jmx-test
>> - Refactor CracProcess to allow multi-waiting
>> - Add better logging to RemoteJmxTest
>
> test/jdk/jdk/crac/RemoteJmxTest.java line 83:
>
>> 81: System.out.println("[CHILD STDOUT] " + line);
>> 82: if (!bootedFuture.isDone()) {
>> 83: if (BOOTED.equals(line)) bootedFuture.complete(null);
>
> This code looks like as if you expect that the messages could be printed multiple times; if that happens this should fail the test (for simplicity I wouldn't mind if it fails by timeout in the end, though, as long as the reason is printed earlier in the log).
>
> I wonder if this could be consolidated with `CracProcess.waitForStdout()` (the least the lines are prefixed here. Maybe the best interface would be
>
> CountDownLatch<Void> watch(String line, boolean positiveMatch);
>
> (called repeatedly to get multiple latches), and `waitForStdout` would use that.
I wanted to use `waitForStdout` initially as well but with the existing implementation it is not possible to use multiple calls to `watch`/`waitForStdout`/`outputAnalyzer` — only the first of such calls will receive the output.
I've refactored our test code now (+ did some cleanup) but since it is pretty big it'll probably require a few fixups so I'm converting this to draft for now.
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/295#discussion_r2799275575
More information about the crac-dev
mailing list