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

Daniel Fuchs dfuchs at openjdk.java.net
Tue Mar 9 10:27:06 UTC 2021


On Tue, 9 Mar 2021 01:31:33 GMT, Alex Menkov <amenkov at openjdk.org> wrote:

> 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)

This looks like a good cleanup to me. Please wait for a review from someone from serviceability-dev before pushing.

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

Marked as reviewed by dfuchs (Reviewer).

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


More information about the serviceability-dev mailing list