Replace SecurityManager use with Java agent #143
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Starting in Java 24 the SecurityManager will be removed from the JDK. Load tests rely on the SecurityManager to intercept calls to System.exit and replace them with an exception to avoid shutting down before all the tests have run. I replaced this with a Java agent that uses ASM to rewrite System.exit calls to throw an exception instead. This change also works for previous Java versions.
This change also updates the ASM library version from 9.0 to 9.7.1 to include Java 24 support. It also adds the asm-commons library as a dependency which is needed to use the org.objectweb.asm.commons.LocalVariablesSorter library.
To validate my changes I ran sanity and extended system tests with OpenJ9 for Java 11 and 24 including the tests that were disabled in adoptium/aqa-tests#5817. In Java 24 there are a few remaining failures related to SecurityManger use in mauve tests that are not related to this change.
As a next step I will be re-enabling the tests that can be run in Java 24.
Fixes: #142