RFR: 8262049: [TESTBUG] Fix TestReferenceRefersTo.java for Shenandoah IU mode [v2]

Roman Kennke rkennke at openjdk.java.net
Mon Feb 22 11:39:18 UTC 2021


On Sat, 20 Feb 2021 13:55:33 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

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

Yes, but which int constant should be used there? Doesn't matter much, I'm not using this at all anymore, following your other suggestions.

> 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.

Right, that is even better. I made the base test generic, extracted the offending parts into its own test, and will push the Shenandoah specific test under a different PR. Thank you!

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

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



More information about the hotspot-gc-dev mailing list