RFR: 8274521: jdk/jfr/event/gc/detailed/TestGCLockerEvent.java fails when other GC is selected

Aleksey Shipilev shade at openjdk.java.net
Fri Oct 1 09:23:33 UTC 2021


On Fri, 1 Oct 2021 09:17:28 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Simple test bug, need to check if G1 is enabled, or it is a default GC before asking `othervm` with `-XX:+UseG1GC`. Other tests in the same directory do exactly that.
>> 
>> Additional testing:
>>  - [x] Affected test skipped with Shenandoah now
>>  - [x] Affected test still passes with G1
>>  - [x] Affected test still passes default GC
>
> test/jdk/jdk/jfr/event/gc/detailed/TestGCLockerEvent.java line 29:
> 
>> 27:  * @key jfr
>> 28:  * @requires vm.hasJFR
>> 29:  * @requires vm.gc == "G1" | vm.gc == null
> 
> I think this should instead be `@requires vm.gc.G1`.  The null check is wrong if running with a build that doesn't include G1 and the default GC is being used.

True, it does look suspicious. I matched what other tests in the same folder are doing. Maybe we should fix them all at once in the followup PR?

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

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


More information about the hotspot-dev mailing list