RFR: 8262049: [TESTBUG] Shenandoah: Adjustments in TestReferenceRefersTo.java for IU mode

Kim Barrett kbarrett at openjdk.java.net
Sat Feb 20 14:04:39 UTC 2021


On Fri, 19 Feb 2021 19:48:51 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

> Shenandoah's IU mode allows referents to be cleared even when accessed during concurrent marking. The test TestReferenceRefersTo.java needs to be adjusted to allow for that.
> 
> Test:
>  - [x] TestReferenceRefersTo.java + Shenandoah/IU
>  - [x] TestReferenceRefersTo.java + Shenandoah/SATB
>  - [x] TestReferenceRefersTo.java + G1

Changes requested by kbarrett (Reviewer).

test/hotspot/jtreg/gc/TestReferenceRefersTo.java line 166:

> 164: 
> 165:     private static boolean isShenandoahIUMode() {
> 166:         return WB.getBooleanVMFlag("UseShenandoahGC") && "iu".equals(WB.getStringVMFlag("ShenandoahGCMode"));

This should be using sun.hotspot.gc.GC.Shenandoah.isSelected()

test/hotspot/jtreg/gc/TestReferenceRefersTo.java line 211:

> 209:             } else {
> 210:               expectNotCleared(testWeak4, "testWeak4");
> 211:             }

I think I would prefer to keep this test program "generic", rather than having this Shenandoah IU mode intrusion.  So remove the old check of testWeak4 state here, and remove the check of obj4 below.  Instead, change the later check of testWeak4 being notified, where the new test is that either testWeak4 and obj4 are both null (IU and the like) or both are non-null (SATB and others).  Then add a couple of tests programs for the specific clearing or not clearing expected behaviors, with appropriate `@requires` restrictions.

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

PR: https://git.openjdk.java.net/jdk/pull/2653



More information about the hotspot-gc-dev mailing list