chore: remove unneeded -Xshare:off from the Surefire argLine - #24037
Merged
Conversation
`-Xshare:off` was added to surefireArgLine in the Mockito 5.18 upgrade (#24006), alongside the byte-buddy startup agent. It disables Class Data Sharing — a JVM default that speeds startup — but it isn't needed: the byte-buddy agent and CDS coexist fine, since a class the inline mock maker redefines simply isn't served from the shared archive. Removing the flag restores the JVM's default (-Xshare:auto) without affecting the agent. Verified: the full test workflow is green with CDS enabled, and dhis-support-system (the inline-mock module) passes 227/0/0 locally on Java 21 with CDS on. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



-Xshare:offwas added tosurefireArgLinein the Mockito 5.18 upgrade (#24006), alongside the byte-buddy startup agent. It disables Class Data Sharing — a JVM default that speeds fork startup — but it turns out not to be needed here: the byte-buddy agent and CDS coexist fine, because a class the inline mock maker redefines simply isn't served from the shared archive.This removes the flag and restores the JVM's default (
-Xshare:auto), leaving the byte-buddy agent untouched.Safety is already established:
dhis-support-system(the inline-mock module) passes 227/0/0 locally on Java 21 — the stricter case for the agent than CI's JDK 17 — with CDS on.No measurable wall-clock change is expected (CDS saves on the order of tens of milliseconds per forked JVM); this is cleanup of a flag that was added without need.
🤖 Generated with Claude Code