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

Kevin Walls kevinw at openjdk.org
Tue Dec 23 21:37:00 UTC 2025


On Fri, 19 Dec 2025 11:18:00 GMT, Kevin Walls <kevinw 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.

Just checked a new batch of 30 runs and hit one failure where it iterates 39 times and fails in vmTestbase/nsk/monitoring/GarbageCollectorMXBean/CollectionCounters/CollectionCounters002/TestDescription.java with "collectionCount not increased: 2346 -> 2346".

When 8373917 https://github.com/openjdk/jdk/pull/28876/files is integrated, the parsing of "-iterations=5"  will work, which cuts down the risk of failure further.

These tests are failing in CI so this change makes it better, and should go ahead.

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

PR Comment: https://git.openjdk.org/jdk/pull/28923#issuecomment-3688024933


More information about the serviceability-dev mailing list