RFR: 8372244: ZGC: Split ZTest into a VM and not VM test fixture

Axel Boldt-Christmas aboldtch at openjdk.org
Thu Nov 20 09:30:25 UTC 2025


The `ZTest` GTest fixture is used for both VM and not VM tests, however the implementation requires VM. The not VM tests which use it are only interested in a sub-set of its features.

I propose we split `ZTest` into a hierarchy of fixtures, one for not VM tests, and the other for VM tests.

I could not find an easy way to identity which category of test a fixture is used in, so for now we just have to be diligent to use the appropriate fixture.

We do have an assumption here that `os::next_random` is fine to call without having setup the VM. If this is changes in future we would have to add a not VM dependent prng function. 

Also the VMless fixture do not test if the OS is supported, as it might require VM features to work. But tests which run without VM should not be dependent if the VM is OS is supported.

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

Depends on: https://git.openjdk.org/jdk/pull/28409

Commit messages:
 - ZGC: Split ZTest into a VM and not VM test fixture

Changes: https://git.openjdk.org/jdk/pull/28414/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28414&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8372244
  Stats: 37 lines in 11 files changed: 16 ins; 8 del; 13 mod
  Patch: https://git.openjdk.org/jdk/pull/28414.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28414/head:pull/28414

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


More information about the hotspot-gc-dev mailing list