Skip to content

chore: remove unneeded -Xshare:off from the Surefire argLine - #24037

Merged
stian-sandvold merged 1 commit into
masterfrom
chore/revert-xshare-off
May 30, 2026
Merged

chore: remove unneeded -Xshare:off from the Surefire argLine#24037
stian-sandvold merged 1 commit into
masterfrom
chore/revert-xshare-off

Conversation

@stian-sandvold

Copy link
Copy Markdown
Contributor

-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 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:

  • The full test workflow runs green with CDS enabled.
  • 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

`-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>
@sonarqubecloud

Copy link
Copy Markdown

@stian-sandvold
stian-sandvold merged commit 861ac30 into master May 30, 2026
22 checks passed
@stian-sandvold
stian-sandvold deleted the chore/revert-xshare-off branch May 30, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant