RFR: 8305186: Reference.waitForReferenceProcessing should be more accessible to tests [v8]
Brent Christian
bchristi at openjdk.org
Wed Apr 23 00:23:57 UTC 2025
> Certain specific types of tests involving GC and reference processing need to account for the delay between a GC completing (during which the GC clears a Reference), and the Reference being added to its associated queue. At present, ad hoc mechanisms (with delays/timeout) are used, but can lead to intermittent test failures ([JDK-8298783](https://bugs.openjdk.org/browse/JDK-8298783) is a recent example).
>
> A better mechanism already exists in the private `Reference.waitForReferenceProcessing()` method. This PR makes `waitForReferenceProcessing()` available to tests via the `WhiteBox` and `ForceGC` test libraries.
Brent Christian has updated the pull request incrementally with one additional commit since the last revision:
make waitForReferenceProcessingMethod volatile
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/24527/files
- new: https://git.openjdk.org/jdk/pull/24527/files/8f486e78..316800ae
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=24527&range=07
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=24527&range=06-07
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/24527.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/24527/head:pull/24527
PR: https://git.openjdk.org/jdk/pull/24527
More information about the core-libs-dev
mailing list