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

Axel Boldt-Christmas aboldtch at openjdk.org
Wed Nov 5 19:05:59 UTC 2025


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

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

Commit messages:
 - Fix ZGC gtests with dependency on test execution order

Changes: https://git.openjdk.org/jdk/pull/28160/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28160&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8371343
  Stats: 11 lines in 3 files changed: 0 ins; 4 del; 7 mod
  Patch: https://git.openjdk.org/jdk/pull/28160.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28160/head:pull/28160

PR: https://git.openjdk.org/jdk/pull/28160


More information about the hotspot-gc-dev mailing list