RFR: 8320198: some reference processing tests don't wait long enough for reference processing to complete

Tom Rodriguez never at openjdk.org
Thu Dec 7 17:08:51 UTC 2023


On Thu, 7 Dec 2023 05:18:26 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> This slightly increases the wait for reference processing to complete to accommodate long Xcomp compile times.  Testing is underway.
>
> test/jdk/java/lang/Object/FinalizationOption.java line 89:
> 
>> 87:     static boolean checkFinalizerCalled(boolean expected) {
>> 88:         create();
>> 89:         for (int i = 0; i < 100; i++) {
> 
> Hello Tom, I think this entire loop can be replaced by using the `jdk.test.lib.util.ForceGC` utility class available in the tests. That class has the necessary knowledge of using the jtreg timeout factor. I think you could replace this loop with something like (I haven't tried it):
> 
> 
>  ForceGC.wait(() -> finalizerWasCalled);

Thanks for the tip.  I'll take a look at.  Even if there isn't something that's exactly right I think having a general waitForReferenceProcessing helper would be a good idea for any tests which do this.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16956#discussion_r1419305640


More information about the core-libs-dev mailing list