Test update for an occasional failure, which does not reproduce. The test failure in JDK-8303136 is at line 141 in the updated file here. It's the failure where isExceeded is true, but our sampled "used" value is not above the threshold. But while the comment says it's refreshing values, it does not not refresh "used", so there could have been gc/promotion activity which hits the threshold outside of the test's control. Refreshing "used" is the addition here.
Separately, the code at line 123 in the new file also claims to refresh the values, but it only refreshes the threshold, which we aren't changing. Not making it refresh "used" at that point looks correct, so remove the "if (used >= threshold)" as we have already checked that at line 116. ------------- Commit messages: - 8303136: MemoryPoolMBean/isCollectionUsageThresholdExceeded/isexceeded005 failed Changes: https://git.openjdk.org/jdk/pull/12823/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12823&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8303136 Stats: 12 lines in 1 file changed: 1 ins; 4 del; 7 mod Patch: https://git.openjdk.org/jdk/pull/12823.diff Fetch: git fetch https://git.openjdk.org/jdk pull/12823/head:pull/12823 PR: https://git.openjdk.org/jdk/pull/12823