Skip to content

Migrate dd-java-agent groovy files to java part 1 - #13136

Open
jpbempel wants to merge 1 commit into
masterfrom
jpbempel/g2j-agent-pt1
Open

jpbempel wants to merge 1 commit into
masterfrom
jpbempel/g2j-agent-pt1

Conversation

@jpbempel

@jpbempel jpbempel commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

What Does This Do

we migrate 10 tests:

  • AgentLoadedIntoBootstrapTest
  • CustomLogManagerTest
  • CustomMBeanServerBuilderTest
  • DDInfoTest
  • InitializationTelemetryTest
  • InstrumenterUnloadTest
  • JMXFetchTest
  • ListIntegrationsTest
  • LogLevelTest
  • SecurityManagerTest

Motivation

this is part of the effort to migrate groovy tests to Java/JUnit

Additional Notes

No production code change. These tests mostly fork a JVM with the agent and check its exit code:

  • the near-identical feature methods of LogLevelTest are now a single @TableTest
  • CustomLogManagerTest and CustomMBeanServerBuilderTest share their common JVM arguments through a helper
  • @IgnoreIf(JDK >= 24) becomes @DisabledForJreRange(min = JAVA_24) for the SecurityManager-based tests (verified on JDK 11 as well)

Contributor Checklist

Jira ticket: [PROJ-IDENT]

🤖 Generated with Claude Code

we migrate 10 tests:
 - AgentLoadedIntoBootstrapTest
 - CustomLogManagerTest
 - CustomMBeanServerBuilderTest
 - DDInfoTest
 - InitializationTelemetryTest
 - InstrumenterUnloadTest
 - JMXFetchTest
 - ListIntegrationsTest
 - LogLevelTest
 - SecurityManagerTest

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jpbempel jpbempel added comp: testing Testing tag: no release notes Changes to exclude from release notes type: refactoring tag: ai generated Largely based on code generated by an AI or LLM labels Oct 30, 2026
@jpbempel
jpbempel marked this pull request as ready for review October 30, 2026 16:15
@jpbempel
jpbempel requested a review from a team as a code owner October 30, 2026 16:15
@jpbempel
jpbempel requested review from sarahchen6 and removed request for a team October 30, 2026 16:15
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T16:17:54.932450Z 27f4e9f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@datadog-official datadog-official Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: PASS

More details

The Java migrations preserve the forked-JVM checks, cleanup, and SecurityManager JDK exclusions. Runtime equivalence remains unverified because the tests were not executed.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit 27f4e9f

@datadog-official

datadog-official Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 59.67% (-0.02%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 27f4e9f | Docs | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 13.96 s 13.98 s [-1.0%; +0.7%] (no difference)
startup:insecure-bank:tracing:Agent 12.89 s 12.96 s [-1.2%; +0.1%] (no difference)
startup:petclinic:appsec:Agent 17.19 s 17.11 s [-0.3%; +1.2%] (no difference)
startup:petclinic:iast:Agent 16.98 s 17.06 s [-1.4%; +0.5%] (no difference)
startup:petclinic:profiling:Agent 16.65 s 16.87 s [-2.3%; -0.4%] (maybe better)
startup:petclinic:sca:Agent 17.14 s 17.00 s [+0.0%; +1.7%] (maybe worse)
startup:petclinic:tracing:Agent 16.16 s 16.15 s [-1.0%; +1.1%] (no difference)

Commit: 27f4e9f7 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@sarahchen6 sarahchen6 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

class ListIntegrationsTest {

@Test
void ddTraceDebugFalse() throws Exception {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this naming looks wrong (test doesn't configure trace debug) but also the naming was wrong in the original tests, so I can fix in a follow-up

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left minor comments


private static final String DEFAULT_LOG_LEVEL = "debug";

// Run all tests using forked jvm because groovy has already set the global log manager

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this comment is a bit confusing: why mention Groovy and global log manager in JUnit java test?

Comment on lines +19 to +22
/* Priority: datadog.slf4j.simpleLogger.defaultLogLevel > dd.trace.debug > DD_TRACE_DEBUG
1: INFO LOGS
0: DEBUG Logs
*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: better to be just simple comments //?
Also I do not understand the meaning of comment 1: INFO LOGS and 0: DEBUG Logs
Probably expected exitCode?

Suggested change
/* Priority: datadog.slf4j.simpleLogger.defaultLogLevel > dd.trace.debug > DD_TRACE_DEBUG
1: INFO LOGS
0: DEBUG Logs
*/
// Priority: datadog.slf4j.simpleLogger.defaultLogLevel > dd.trace.debug > DD_TRACE_DEBUG
// INFO Logs exit code: 1
// DEBUG Logs exit code: 0

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: testing Testing tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants