[lworld] RFR: 8327257: [lworld] Tests are needed to stress class preloading with concurrent class loadings
Paul Hübner
phubner at openjdk.org
Tue Sep 9 11:01:46 UTC 2025
Hi all,
This change strengthens our Valhalla-specific classloading test suite and guards against regressions. An overview of the new changes is as follows:
* `BigClassTreeClassLoader`: a utility classloader that generates huge class trees on the fly. The idea is to generate a tree that is deep (lots of parent classes) and very wide (classes have lots of value classes as fields, which have value class fields, etc.).
* `ConcurrentClassLoadingTest` strains the classloading and preloading by classloading many classes at the same time.
* `LoadableDescriptorsTest` ensures that the `LoadableDescriptors` attribute can handle unexpected data. This may need to be revisited if https://bugs.openjdk.org/browse/JDK-8366907 changes the semantics.
* `PreLoadCircularityTest` ensures that preloading happens even when there are cycles (via inheritance, fields, and both).
* `PreLoadDoesNotInitTest` is a regression test that ensures preloading will not initialize a class.
* `PreLoadFailuresDoNotImpactApplicationTest` ensures that a flaky classloader during preloading will not cause crashes as long as the classloader can find the class when it is actually used.
* `ValueClassInheritanceTest` is a regression test that ensures one cannot have a value class inherit from something that's not an abstract value class.
-------------
Commit messages:
- Reindent.
- More reviewer comments.
- Incorporate feedback.
- Move to JUnit and refactor.
- Concurrent non-deadlocking huge tree test.
- Iterate.
- First draft.
Changes: https://git.openjdk.org/valhalla/pull/1552/files
Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1552&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8327257
Stats: 892 lines in 11 files changed: 892 ins; 0 del; 0 mod
Patch: https://git.openjdk.org/valhalla/pull/1552.diff
Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1552/head:pull/1552
PR: https://git.openjdk.org/valhalla/pull/1552
More information about the valhalla-dev
mailing list