Skip to content

sent-dm-java: silence byte-buddy agent warning in test JVM args#32

Merged
arbianst merged 1 commit into
mainfrom
sent-dm-java-silence-byte-buddy-agent-warning
May 14, 2026
Merged

sent-dm-java: silence byte-buddy agent warning in test JVM args#32
arbianst merged 1 commit into
mainfrom
sent-dm-java-silence-byte-buddy-agent-warning

Conversation

@arbianst
Copy link
Copy Markdown
Contributor

Summary

  • Adds -XX:+EnableDynamicAgentLoading to the test JVM args in buildSrc/src/main/kotlin/sent.kotlin.gradle.kts.
  • Unblocks sent-java-core:test, which has been failing on every release post-JDK-21 because Mockito's dynamically-attached byte-buddy agent triggers a JVM warning into stderr that LoggingHttpClientTest.errorLevel_logsRequestFailure captures and asserts on verbatim. Most recent failure: release 0.25.0 CI on main.

Why this lives in the repo

This is a Stainless template-bug workaround in the same shape as the PHP publish-packagist.yml URL and TS packages/mcp-server/manifest.json formatting fixes documented in sent-dm-agentic-org's stainless-release skill. Expect it to come back on the next codegen until upstream picks it up.

Test plan

  • CI runs sent-java-core:test clean on this branch (873 tests, previously 1 failing).
  • After merge, re-trigger the Publish Sonatype workflow for 0.25.0 (or cut 0.25.1) so Maven Central gets the release.

JDK 21 prints `WARNING: A Java agent has been loaded dynamically (.../byte-buddy-agent-*.jar)`
to stderr when Mockito attaches its agent at runtime. `LoggingHttpClientTest.errorLevel_logsRequestFailure`
captures stderr and compares verbatim to an expected request/response log, so the warning
prefix breaks the assertion and blocks `sent-java-core:test` — failing CI on every release
post-JDK-21 upgrade (most recently the 0.25.0 publish on 2026-05-14).

Adding `-XX:+EnableDynamicAgentLoading` opts in to dynamic agent loading and suppresses the
warning. This is a Stainless template workaround in the same shape as the PHP packagist URL
and TS MCP manifest formatting fixes documented in the sent-dm-agentic-org stainless-release
skill; expect it back on the next codegen until upstream picks it up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@arbianst arbianst merged commit 622d73d into main May 14, 2026
7 checks passed
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