Integrated: 8305186: Reference.waitForReferenceProcessing should be more accessible to tests
Brent Christian
bchristi at openjdk.org
Fri Apr 25 17:09:12 UTC 2025
On Tue, 8 Apr 2025 20:20:56 GMT, Brent Christian <bchristi at openjdk.org> wrote:
> 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.
This pull request has now been integrated.
Changeset: d8f012ea
Author: Brent Christian <bchristi at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/d8f012ea2a0514020434d5db6047e36941e9349b
Stats: 51 lines in 1 file changed: 51 ins; 0 del; 0 mod
8305186: Reference.waitForReferenceProcessing should be more accessible to tests
Reviewed-by: kbarrett
-------------
PR: https://git.openjdk.org/jdk/pull/24527
More information about the core-libs-dev
mailing list