On Thu, 20 Mar 2025 22:35:23 GMT, Brent Christian <bchri...@openjdk.org> wrote:
> I propose some cleanups to `FinalizerHistogramTest.java` to hopefully clear > up the intermittent failures: > > * run with `othervm`: this test blocks the (global) finalizer thread, and > also requires the (global) finalizer thread to enter the test's `finalize()` > method > * The test uses `volatile` ints, but sets them based on their current value, > which is not reliable; convert to `AtomicInteger` > * use `PhantomReference`s to ensure that at least two `MyObject`s have become > unreachable. If one is stuck in `finalize()`, at least one is still waiting > to be finalized and should show up in the histogram. This pull request has now been integrated. Changeset: fe29cad5 Author: Brent Christian <bchri...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/fe29cad5e0b10cd088fc39967599f5a8dcaa445c Stats: 28 lines in 1 file changed: 14 ins; 1 del; 13 mod 8298783: java/lang/ref/FinalizerHistogramTest.java failed with "RuntimeException: MyObject is not found in test output" Reviewed-by: kbarrett, jpai ------------- PR: https://git.openjdk.org/jdk/pull/24143