On Tue, 8 Apr 2025 20:20:56 GMT, Brent Christian <bchri...@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.

test/lib/jdk/test/lib/util/ForceGC.java line 117:

> 115:      * jtreg tag.
> 116:      *
> 117:      * This method should usually be called after a call to 
> WhiteBox.fullGC().

I suggest waiting until we have a use-case for WFRP _without_ `WB.fullGC` 
before adding this.
That's because I'm doubtful that such a use-case exists.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24527#discussion_r2034131990

Reply via email to