RFR: 8298783: java/lang/ref/FinalizerHistogramTest.java failed with "RuntimeException: MyObject is not found in test output" [v2]

Brent Christian bchristi at openjdk.org
Fri Mar 21 18:41:42 UTC 2025


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

Brent Christian has updated the pull request incrementally with one additional commit since the last revision:

  rename counter variables to use 'Count'

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/24143/files
  - new: https://git.openjdk.org/jdk/pull/24143/files/64f88cd3..efbe07be

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=24143&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24143&range=00-01

  Stats: 6 lines in 1 file changed: 0 ins; 0 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/24143.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24143/head:pull/24143

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


More information about the core-libs-dev mailing list