Skip to content

Migrate dd-trace-core groovy files to java part 13 - #12253

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 6 commits into
masterfrom
jpbempel/g2j-core-pt13
Aug 26, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 6 commits into
masterfrom
jpbempel/g2j-core-pt13

Conversation

@jpbempel

@jpbempel jpbempel commented Aug 21, 2026 •

Copy link
Copy Markdown
Member

What Does This Do

we migrate 17 tests:

  • ConflatingMetricAggregatorTest
  • FootprintForkedTest
  • MetricsAggregatorFactoryTest
  • MetricsReliabilityTest
  • OkHttpSinkTest
  • SerializingMetricWriterTest
  • AllSamplerTest
  • AsmStandaloneSamplerTest
  • DeterministicSpanSamplerTest
  • DeterministicTraceSamplerTest
  • ForcePrioritySamplerTest
  • RateByServiceTraceSamplerTest
  • RuleBasedSamplingTest
  • SamplerTest
  • SingleSpanSamplerTest
  • SpanSamplingRulesTest
  • TraceSamplingRulesTest

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
part11: #11566
part12: #11619

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@jpbempel
jpbempel requested a review from a team as a code owner August 21, 2026 09:21
@jpbempel
jpbempel requested review from jandro996 and removed request for a team August 21, 2026 09:21
@dd-octo-sts

dd-octo-sts Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Add at least one type, and one component or instrumentation label to the pull request

If you need help, please check our contributing guidelines.

@jpbempel jpbempel added comp: testing Testing tag: no release notes Changes to exclude from release notes type: refactoring labels Aug 21, 2026
@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 58.69% (-0.11%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: cd78f21 | Docs | View more details | Give us feedback!

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

Copy link
Copy Markdown

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

ℹ️ 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".

@dd-octo-sts

dd-octo-sts Bot commented Aug 21, 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 14.77 s 14.72 s [-0.4%; +1.2%] (no difference)
startup:insecure-bank:tracing:Agent 13.63 s 13.70 s [-1.6%; +0.6%] (no difference)
startup:petclinic:appsec:Agent 17.38 s 16.59 s [+0.4%; +9.1%] (maybe worse)
startup:petclinic:iast:Agent 17.48 s 17.50 s [-0.9%; +0.7%] (no difference)
startup:petclinic:profiling:Agent 17.44 s 17.32 s [-0.5%; +1.9%] (no difference)
startup:petclinic:sca:Agent 17.47 s 17.28 s [+0.1%; +2.1%] (maybe worse)
startup:petclinic:tracing:Agent 16.50 s 16.79 s [-2.6%; -0.8%] (maybe better)

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

@datadog-datadog-us1-prod datadog-datadog-us1-prod Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Datadog Autotest: FAIL

The Java migration weakens one exact call-count check. A repeated startBucket call now passes in the serialization-error test, but the old Groovy test rejects it.

Open Bits AI session

🤖 Datadog Autotest · Commit 37bcdd1 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

@PerfectSlayer PerfectSlayer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Left minor comment about reusing environment component for test deactivation

@jpbempel
jpbempel requested review from a team as code owners August 24, 2026 15:27
@jpbempel
jpbempel requested review from mhdatie and mhlidd and removed request for a team August 24, 2026 15:27

@datadog-datadog-us1-prod datadog-datadog-us1-prod Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Datadog Autotest: PASS

More details

The migrated blank Number cell becomes null before type conversion. TableTest passes null to the non-primitive parameter, so the reported converter failure does not occur.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Datadog Autotest · Commit 1533ac5 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

@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.

Small notes, but otherwise LGTM

@mhdatie mhdatie 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.

I ran pr-review-toolkit:code-reviewer locally and I'm only pasting the critical issues instead of the entire blob (it might be worth running it locally). Feel free to discard what's not appropriate for this PR


Critical Issues (must fix before merge):

  • [assertions] ClientStatsAggregatorTest.java:1976 — Groovy's 1 * writer.add({...}) >> { assert e.getHitCount()==1 && e.getDuration()==duration } became verify(writer).add(argThat(e -> AggregateEntryTestUtils.equals(e, expected))), whose shared equals() explicitly excludes counter/histogram state. Nothing now checks hit count or duration. Fix: mirror the doAnswer on add(...) used by sibling shouldReportPeriodically (:2016-2023).
  • [resources] ClientStatsAggregatorTest.java — 28 aggregator.close() calls with zero finally in the whole file (verified: grep for finally returns 0). Since assertions are latch/timing-based, any assertion failure leaks a started reporter thread + inbox for the rest of the JVM fork, risking cascading failures in unrelated tests. Inconsistent with sibling files in the same PR (ClientStatsAggregatorDisableTest, ClientStatsAggregatorBootstrapTest, FootprintForkedTest) which correctly use try/finally. Fix: hold aggregator in a field, close in @AfterEach.
  • [resources] OkHttpSinkTest.java:101 — unbounded latch.await() with no timeout; a listener that never fires hangs the Gradle worker instead of failing. MetricsReliabilityTest got this right (await(10, SECONDS)) — inconsistency within the same PR.
  • [JUnit hygiene] ClientStatsAggregatorTest.java:2241-2246 — hand-rolled try { ...; throw new AssertionError(...) } catch (TimeoutException expected) {} instead of assertThrows. As written, the AssertionError path also skips the close() at :2255, compounding the resource leak above.

@jpbempel

Copy link
Copy Markdown
Member Author
  • [assertions] ClientStatsAggregatorTest.java:1976 — Groovy's 1 * writer.add({...}) >> { assert e.getHitCount()==1 && e.getDuration()==duration } became verify(writer).add(argThat(e -> AggregateEntryTestUtils.equals(e, expected))), whose shared equals() explicitly excludes counter/histogram state. Nothing now checks hit count or duration. Fix: mirror the doAnswer on add(...) used by sibling shouldReportPeriodically (:2016-2023).

fixed

  • [resources] ClientStatsAggregatorTest.java — 28 aggregator.close() calls with zero finally in the whole file (verified: grep for finally returns 0). Since assertions are latch/timing-based, any assertion failure leaks a started reporter thread + inbox for the rest of the JVM fork, risking cascading failures in unrelated tests. Inconsistent with sibling files in the same PR (ClientStatsAggregatorDisableTest, ClientStatsAggregatorBootstrapTest, FootprintForkedTest) which correctly use try/finally. Fix: hold aggregator in a field, close in @AfterEach.

fixed

  • [resources] OkHttpSinkTest.java:101 — unbounded latch.await() with no timeout; a listener that never fires hangs the Gradle worker instead of failing. MetricsReliabilityTest got this right (await(10, SECONDS)) — inconsistency within the same PR.

issue exists in previous version, will do a followup in a next PR

  • [JUnit hygiene] ClientStatsAggregatorTest.java:2241-2246 — hand-rolled try { ...; throw new AssertionError(...) } catch (TimeoutException expected) {} instead of assertThrows. As written, the AssertionError path also skips the close() at :2255, compounding the resource leak above.

fixed

@jpbempel
jpbempel enabled auto-merge August 26, 2026 09:27
@jpbempel
jpbempel force-pushed the jpbempel/g2j-core-pt13 branch from f881a10 to 5d41c0e Compare August 26, 2026 11:24
we migrate 17 tests:
 - ConflatingMetricAggregatorTest
 - FootprintForkedTest
 - MetricsAggregatorFactoryTest
 - MetricsReliabilityTest
 - OkHttpSinkTest
 - SerializingMetricWriterTest
 - AllSamplerTest
 - AsmStandaloneSamplerTest
 - DeterministicSpanSamplerTest
 - DeterministicTraceSamplerTest
 - ForcePrioritySamplerTest
 - RateByServiceTraceSamplerTest
 - RuleBasedSamplingTest
 - SamplerTest
 - SingleSpanSamplerTest
 - SpanSamplingRulesTest
 - TraceSamplingRulesTest
@jpbempel
jpbempel disabled auto-merge August 26, 2026 19:42
@jpbempel
jpbempel enabled auto-merge August 26, 2026 19:42
@jpbempel
jpbempel disabled auto-merge August 26, 2026 19:44
@jpbempel
jpbempel enabled auto-merge August 26, 2026 19:44
@jpbempel

Copy link
Copy Markdown
Member Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-08-26 19:45:22 UTC ℹ️ Start processing command /merge


2026-08-26 19:45:30 UTC ℹ️ MergeQueue: Pull request is not mergeable yet

It will be processed automatically as soon as GitHub reports it as mergeable. View in MergeQueue UI.

  • Run /code blockers to see what is blocking it.
  • Run /remove to cancel it.

2026-08-26 19:59:19 UTC ⚠️ MergeQueue: This merge request was unqueued

This pull request was closed.

@jpbempel

Copy link
Copy Markdown
Member Author

/code blockers

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-08-26 19:57:03 UTC ℹ️ Start processing command /code blockers


2026-08-26 19:57:04 UTC ℹ️ Devflow:

Checking merge blockers for #12253...


2026-08-26 19:57:08 UTC ℹ️ Devflow: /code blockers

Detected 5 merge blocker(s) to address:

🔴 Blocking

  • Required check Check pull request labels has not reported
    Hint: Ensure the workflow that produces this check is triggered.
  • Required check Check pull requests has not reported
    Hint: Ensure the workflow that produces this check is triggered.
  • Required check Check system tests success has not reported
    Hint: Ensure the workflow that produces this check is triggered.
  • Required check Enforce Groovy migration has not reported
    Hint: Ensure the workflow that produces this check is triggered.
  • Required check Merge queue check has not reported
    Hint: Ensure the workflow that produces this check is triggered.

@sarahchen6 sarahchen6 added tag: no release notes Changes to exclude from release notes and removed tag: no release notes Changes to exclude from release notes labels Aug 26, 2026
@sarahchen6 sarahchen6 closed this Aug 26, 2026
auto-merge was automatically disabled August 26, 2026 19:59

Pull request was closed

@sarahchen6 sarahchen6 reopened this Aug 26, 2026
@sarahchen6

Copy link
Copy Markdown
Contributor

/merge -@ 1 hour

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-08-26 20:02:00 UTC ℹ️ Start processing command /merge -@ 1 hour


2026-08-26 20:02:02 UTC ℹ️ MergeQueue: merge request scheduled for Wed, 26 Aug 2026 21:02:00 UTC

Pull Request scheduled to be added to the queue on Wed, 26 Aug 2026 21:02:00 UTC


2026-08-26 21:02:05 UTC ℹ️ MergeQueue: merge request added to the queue

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


2026-08-26 21:13:00 UTC ❌ MergeQueue: The build pipeline contains failing jobs for this merge request

Build pipeline has failing jobs for c7474dc:

⚠️ Do NOT retry failed jobs directly (why?).

What to do next?

  • Investigate the failures and when ready, re-add your pull request to the queue!
  • If your PR checks are green, try to rebase/merge. It might be because the CI run is a bit old.
  • Any question, go check the FAQ.
Details

Since those jobs are not marked as being allowed to fail, the pipeline will most likely fail.
Therefore, and to allow other builds to be processed, this merge request has been rejected and the pipeline got canceled.

@jpbempel
jpbempel added this pull request to the merge queue Aug 26, 2026
@dd-octo-sts

dd-octo-sts Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-08-26 20:37:57 UTC ℹ️ Start processing command /merge


2026-08-26 20:37:59 UTC ❌ MergeQueue

PR already in the queue with status delayed

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 26, 2026
@sarahchen6

Copy link
Copy Markdown
Contributor

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-08-26 21:48:47 UTC ℹ️ Start processing command /merge


2026-08-26 21:48:52 UTC ℹ️ MergeQueue: pull request added to the queue

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


2026-08-26 22:34:53 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit d49562f into master Aug 26, 2026
602 of 604 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the jpbempel/g2j-core-pt13 branch August 26, 2026 22:34
@github-actions github-actions Bot added this to the 1.66.0 milestone Aug 26, 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.

6 participants