Skip to content

Migrate dd-trace-core groovy files to java part 11#11566

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
jpbempel/g2j-core-pt11
Jun 4, 2026
Merged

Migrate dd-trace-core groovy files to java part 11#11566
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
masterfrom
jpbempel/g2j-core-pt11

Conversation

@jpbempel
Copy link
Copy Markdown
Member

@jpbempel jpbempel commented Jun 4, 2026

What Does This Do

we migrate 11 tests:

  • PrintingWriterTest
  • TraceStructureWriterTest
  • CiVisibilityApmProtocolInterceptorTest
  • CiVisibilityTraceInterceptorTest
  • CiTestCovMapperV2Test
  • CiTestCycleMapperV1PayloadTest
  • LambdaAppSecHandlerTest
  • LambdaHandlerTest
  • SkipUnhandledTypeJsonSerializerTest
  • LLMObsSpanMapperTest
  • TracerConnectionReliabilityTest

Motivation

this is part of the effort to migrate groovy tests to Java/JUnit
part1: #11053
part2: #11062
part3: #11085
part4: #11146
part5: #11217
part6: #11362
part7: #11374
part8: #11437
part9: #11488
part10: #11543

Additional Notes

Contributor Checklist

  • Format the title according to the contribution guidelines
  • Assign the type: and (comp: or inst:) labels in addition to any other useful labels
  • Avoid using close, fix, or any linking keywords when referencing an issue
    Use solves instead, and assign the PR milestone to the issue
  • Update the CODEOWNERS file on source file addition, migration, or deletion
  • Update public documentation with any new configuration flags or behaviors
  • Add your completed PR to the merge queue by commenting /merge. You can also:
    • Customize the commit message associated with the merge with /merge --commit-message "..."
    • Remove your PR from the merge queue with /merge -c
    • Skip all merge queue checks with /merge -f --reason "reason"; please use this judiciously, as some checks do not run at the PR-level (note: the PR still needs to be mergeable, this will only skip the pre-merge build)
    • Get more information in this doc

Jira ticket: [PROJ-IDENT]

we migrate 11 tests:
 - PrintingWriterTest
 - TraceStructureWriterTest
 - CiVisibilityApmProtocolInterceptorTest
 - CiVisibilityTraceInterceptorTest
 - CiTestCovMapperV2Test
 - CiTestCycleMapperV1PayloadTest
 - LambdaAppSecHandlerTest
 - LambdaHandlerTest
 - SkipUnhandledTypeJsonSerializerTest
 - LLMObsSpanMapperTest
 - TracerConnectionReliabilityTest
@jpbempel jpbempel requested review from a team as code owners June 4, 2026 15:20
@jpbempel jpbempel requested a review from amarziali June 4, 2026 15:20
@jpbempel jpbempel added comp: testing Testing tag: no release notes Changes to exclude from release notes type: refactoring labels Jun 4, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f4a032df81

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@Test
void processRequestStartHandlesExceptionDuringStreamReading() throws IOException {
ByteArrayInputStream mockStream = mock(ByteArrayInputStream.class);
when(mockStream.available()).thenThrow(new IOException("Stream error"));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid stubbing a checked exception on available()

When this test runs, Mockito rejects thenThrow(new IOException(...)) here because ByteArrayInputStream.available() does not declare IOException; the stubbing fails with a Mockito checked-exception error before processRequestStart is exercised. Use a subclass/test stream that can throw from a method the handler calls, or throw an unchecked exception if that is the path being tested.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Wrong, the mocking works perfectly. checked expcetion are not visible by the JVM. only javac is checking them. So if a method is not declaring a checked exception this is not an issue

@datadog-official

This comment has been minimized.

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented Jun 4, 2026

🟢 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 14.84 s 14.54 s [+0.8%; +3.4%] (maybe worse)
startup:insecure-bank:tracing:Agent 13.52 s 13.72 s [-2.8%; +0.0%] (no difference)
startup:petclinic:appsec:Agent 16.46 s 16.35 s [-0.7%; +2.0%] (no difference)
startup:petclinic:iast:Agent 16.47 s 16.51 s [-1.3%; +0.8%] (no difference)
startup:petclinic:profiling:Agent 16.35 s 16.39 s [-1.4%; +0.9%] (no difference)
startup:petclinic:tracing:Agent 15.84 s 14.93 s [-2.6%; +14.9%] (unstable)

Commit: f4a032df · 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.

@jpbempel jpbempel added this pull request to the merge queue Jun 4, 2026
@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented Jun 4, 2026

/merge

@gh-worker-devflow-routing-ef8351
Copy link
Copy Markdown

gh-worker-devflow-routing-ef8351 Bot commented Jun 4, 2026

View all feedbacks in Devflow UI.

2026-06-04 17:08:11 UTC ℹ️ Start processing command /merge


2026-06-04 17:08:16 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-06-04 18:17:19 UTC ℹ️ MergeQueue: This merge request was merged

@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 4, 2026
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit 615f932 into master Jun 4, 2026
761 of 772 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the jpbempel/g2j-core-pt11 branch June 4, 2026 18:17
@github-actions github-actions Bot added this to the 1.64.0 milestone Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: testing Testing 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.

2 participants