RFR: 8298783: java/lang/ref/FinalizerHistogramTest.java failed with "RuntimeException: MyObject is not found in test output" [v9]

Brent Christian bchristi at openjdk.org
Sun May 4 03:52:50 UTC 2025


On Sat, 3 May 2025 00:35:44 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Brent Christian has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   remove unneeded 'trappedCount'
>
> test/jdk/java/lang/ref/FinalizerHistogramTest.java line 78:
> 
>> 76:                 refProResult = wb.waitForReferenceProcessing();
>> 77:                 System.out.println("waitForReferenceProcessing returned: " + refProResult);
>> 78:             } while (refProResult);
> 
> Why the spammy output?  Why not just
> 
> while (wb.waitForReferenceProcessing()) {}

Right now, the test just it prints a single line:
`waitForReferenceProcessing returned: false`
and I expect this to continue to be true.

For intermittently failing tests, I'm inclined to add a little extra output as long as I'm fiddling with it anyway. That way, if the test ever starts failing again, we have some (hopefully useful) clues about what happened.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24143#discussion_r2072512987


More information about the core-libs-dev mailing list