sent-dm-java: silence byte-buddy agent warning in test JVM args#32
Merged
Merged
Conversation
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>
1 task
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.
Summary
-XX:+EnableDynamicAgentLoadingto the test JVM args inbuildSrc/src/main/kotlin/sent.kotlin.gradle.kts.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 thatLoggingHttpClientTest.errorLevel_logsRequestFailurecaptures 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.ymlURL and TSpackages/mcp-server/manifest.jsonformatting fixes documented insent-dm-agentic-org'sstainless-releaseskill. Expect it to come back on the next codegen until upstream picks it up.Test plan
sent-java-core:testclean on this branch (873 tests, previously 1 failing).Publish Sonatypeworkflow for 0.25.0 (or cut 0.25.1) so Maven Central gets the release.