RFR: 8262001: java/lang/management/ThreadMXBean/ResetPeakThreadCount.java failed with "RuntimeException: Current Peak = 14 Expected to be == previous peak = 7 + 8"

Alex Menkov amenkov at openjdk.java.net
Tue Mar 9 01:36:21 UTC 2021


The fix updates ResetPeakThreadCount.java test - increases number of threads, but relaxes conditions so start/termination of system threads don't cause failures.
Additional changes:
- store threads in a list instead of array (we need only to start/terminate some number of threads, so linked list works better);
- flags for thread termination are moved to thread class;
- store values from ThreadMXBean.getPeakThreadCount() and getThreadCount() in int instead of long (the methods return int values)

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

Commit messages:
 - Update ResetPeakThreadCount.java

Changes: https://git.openjdk.java.net/jdk/pull/2885/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2885&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8262001
  Stats: 139 lines in 1 file changed: 20 ins; 61 del; 58 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2885.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2885/head:pull/2885

PR: https://git.openjdk.java.net/jdk/pull/2885


More information about the serviceability-dev mailing list