RFR: Test @requires should check what GC is enabled at runtime

Aleksey Shipilev shade at redhat.com
Fri Nov 30 16:12:13 UTC 2018


On 11/30/18 4:03 PM, Roman Kennke wrote:
> Hi Aleksey,
> 
>> http://cr.openjdk.java.net/~shade/shenandoah/requires-runtime/webrev.01/
>>
>> This rewires our @requires handling again! @requires is messy, and new filtering code is based on
>> understanding that:
>>  a) "vm.gc.Shenandoah" says "Shenandoah is available in builds, and can be selected"
>>  b) "vm.gc == null" says "...and we are running with default GC"
>>  c) "vm.gc = Shenandoah" says "...or user specified -XX:+UseShenandoahGC in jtreg opts"
> 
> I assume that what you say is true :-) But...
> 
> doesn't this mean that for our own tests, under gc/shenandoah, it is ok
> & sufficient to have: @requires vm.gc.Shenandoah ? Because if it's
> available in build, we can run the test, and then we set
> -XX:+UseShenandoahGC ?

Wait a minute. I misunderstood the semantics of vm.gc.Shenandoah. It is actually "true" if
-XX:+UseShenandoahGC can be set: it is supported by build, and no other GC is explicitly selected.
So, for the tests that explicitly set -XX:+UseShenandoahGC we have to put @requires
vm.gc.Shenandoah, and for other tests that _can_ be run with Shenandoah by external option, we
should use @requires vm.gc != "Shenandoah".

This patch does so:
  http://cr.openjdk.java.net/~shade/shenandoah/requires-runtime/webrev.02

Still passes the same battery of tests.

-Aleksey



More information about the shenandoah-dev mailing list