RFR: 8371343: ZGC: Remove dependency on test execution order for gtests

Erik Österlund eosterlund at openjdk.org
Thu Nov 6 13:34:08 UTC 2025


On Wed, 5 Nov 2025 18:58:56 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

> We currently have a few gtests which are run with the TEST_F macro and use `ZGlobalsPointers::initialize();` which on some platforms may end up doing GC precious logging, which requires the VM (mutexes) to be setup in order to work. Currently the `GTestWrapper.java` succeeds with running these test because we will have run other tests which have setup the VM.
> 
> If a filter is used or the tests are shuffled we can observe that these tests may crash.
> 
> Proposed change is to use the `ZTest` unittest base fixture and run these test with `TEST_VM_F`
> 
> Testing
>  * GHA
>  * gtests with and without filter and shuffled test order

Looks good.

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

Marked as reviewed by eosterlund (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/28160#pullrequestreview-3428207028


More information about the hotspot-gc-dev mailing list