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.

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

Commit messages:
 - limit iterations
 - JDK-8373642: Test 
vmTestbase/nsk/monitoring/GarbageCollectorMXBean/CollectionCounters/CollectionCounters003/TestDescription.java
 failed

Changes: https://git.openjdk.org/jdk/pull/28923/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28923&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8373642
  Stats: 23 lines in 5 files changed: 7 ins; 5 del; 11 mod
  Patch: https://git.openjdk.org/jdk/pull/28923.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28923/head:pull/28923

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

Reply via email to