RFR: 8372243: ZGC: ZForwardingTest.find_every_other is mistaken for a other VM gtest
Axel Boldt-Christmas
aboldtch at openjdk.org
Thu Nov 20 09:17:21 UTC 2025
The current implementation of our GTest runner identifies the category of test by the suffix it adds.
This is either `_vm`, `_other_vm` or `_vm_assert`. This is problematic for `ZForwardingTest.find_every_other` which is a VM test and ends up with the final name `ZForwardingTest.find_every_other_vm` and is mistaken for an other VM test in the filters, but is run as a VM test. Currently `ZForwardingTest.find_every_other` if another VM test has been ran first.
I propose we enhance our GTest category naming to make this thing impossible by:
1. Change `_vm`, `_other_vm` and `_vm_assert` to `__vm`, `__other_vm` and `__vm_assert`
2. Fail to compile tests which end in `_`, `__vm`, `__other_vm` or `__vm_assert`
Note that this patch uses an undecided hotspot feature in the gtest launcher `std::string_view`.
It would be very unfortunate to not be able to use this feature, as without it (or a similar construction) performing static checking of strings and sub-strings is rather cumbersome.
-------------
Depends on: https://git.openjdk.org/jdk/pull/28409
Commit messages:
- ZGC: ZForwardingTest.find_every_other is mistaken for a other VM gtest
Changes: https://git.openjdk.org/jdk/pull/28412/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28412&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8372243
Stats: 41 lines in 7 files changed: 18 ins; 6 del; 17 mod
Patch: https://git.openjdk.org/jdk/pull/28412.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28412/head:pull/28412
PR: https://git.openjdk.org/jdk/pull/28412
More information about the hotspot-runtime-dev
mailing list