RFR: 8373642: Test vmTestbase/nsk/monitoring/GarbageCollectorMXBean/CollectionCounters/CollectionCounters003/TestDescription.java failed

Kevin Walls kevinw at openjdk.org
Tue Dec 23 09:31:55 UTC 2025


On Mon, 22 Dec 2025 19:07:43 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

>> In JDK-8370731 I made this test much too thorough.  It was good to ensure some testing was always done, but fixing the existing loop within runOne() was wrong.  We have an outer loop already in the run() method.
>> 
>> 20, 30 or 137 (!) iterations is unnecessary.  Eventually or occasionally an iteration does not cause a collection.
>> Limiting to 5 iterations.
>> 
>> This depends on the change in https://github.com/openjdk/jdk/pull/28876/files to use "-iterations=" consistently like (a few) other tests.
>> 
>> Tests that do some allocation and check for a collection can be unreliable.
>> This may also benefit from what is proposed in https://github.com/openjdk/jdk/pull/28891
>> 
>> I'd like to get this change in though, as the test may fail more now than before.
>
> test/hotspot/jtreg/vmTestbase/nsk/monitoring/GarbageCollectorMXBean/CollectionCounters/CollectionCounters001/CollectionCounters001.java line 83:
> 
>> 81:                 updateCounters();
>> 82:                 validate(false /* don't check gc count increases */);
>> 83:                 Algorithms.eatMemory(stresser);
> 
> Are you going to file a separate issue to use WB.fullGC()? Are there other monitoring tests that could also benefit from this?

Yes, would like to integrate this one soon as it makes the test more reliable, my earlier change may have made it less reliable (it tests more aggressively, it never skips and likely does more iterations).  Want to follow up with a survey of what other tests the Whitebox can be useful for, maybe not just this one.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28923#discussion_r2642560582


More information about the serviceability-dev mailing list