Skip to content

Read only SmapEntry events in SmapEntryCacheTest recording check - #13615

Draft
cgcote wants to merge 1 commit into
masterfrom
dd/automated/flaky-fix-smap-jfr-event-filter-2026-11-21
Draft

cgcote wants to merge 1 commit into
masterfrom
dd/automated/flaky-fix-smap-jfr-event-filter-2026-11-21

Conversation

@cgcote

@cgcote cgcote commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

What Does This Do

Makes SmapEntryCacheTest.preservesMixedPathEncodingsInRecording() read the pathname field only from SmapEntryEvent events in the dumped JFR recording. Other event types in the dump are skipped. The exact assertion on the two expected pathnames and their order is unchanged. This is a test-only change.

Motivation

Root cause: The test went through every event in the RecordingFile and called getString("pathname") on each one. A JFR dump is not limited to the events enabled on the test's own Recording. When another recording is active in the same JVM (for example, one started by other profiling tests in the module), the dump also contains other event types, such as jdk.ActiveRecording and jdk.ActiveSetting. Those events have no pathname field, so the test fails with:

java.lang.IllegalArgumentException: "Attempt to get unknown field "pathname"
  at jdk.jfr.consumer.RecordedObject.getValueDescriptor(RecordedObject.java:255)
  at jdk.jfr.consumer.RecordedObject.getString(RecordedObject.java:669)
  at ...SmapEntryCacheTest.preservesMixedPathEncodingsInRecording(SmapEntryCacheTest.java:94)

The fix compares each event's type name with EventType.getEventType(SmapEntryEvent.class).getName() before reading pathname. This removes the cause instead of making it less likely.

Impact (Datadog Flaky Test Management):

  • Family: 1 test, com.datadog.profiling.controller.openjdk.events.SmapEntryCacheTest.preservesMixedPathEncodingsInRecording().
  • Representative fingerprint: 7de157655f1cf613. Attempt-to-fix ID: FBPWT2 (DD_FBPWT2).
  • CI impact: FTM reports a 50% failure rate, 43 failed pipelines and about 242h of CI time lost. Failures appear on master, the merge queue and feature branches, on all tested JVMs.
  • FTM: https://app.datadoghq.com/ci/test/flaky?query=fingerprint_fqn%3A7de157655f1cf613

Additional Notes

Testing (run in the Bits Code session, as reported by the session):

  • ./gradlew :dd-java-agent:agent-profiling:profiling-controller-openjdk:test --tests 'com.datadog.profiling.controller.openjdk.events.SmapEntryCacheTest': 15 cases passed. Two more --rerun runs also passed 15/15.
  • ./gradlew :dd-java-agent:agent-profiling:profiling-controller-openjdk:test --rerun (full module): 48 passed, 2 skipped, 0 failures.
  • ./gradlew :dd-java-agent:agent-profiling:profiling-controller-openjdk:spotlessCheck: passed.
  • Standalone reproduction with a second JFR recording running at the same time: the original loop failed 10/10 with the same unknown-field error. The filtered loop passed 10/10 with the exact pathname order.
  • Only the session's local JVM was used. Other JVMs are left to CI.

Risks: Very low. The change only touches one test method, and there are no production code changes. There are no sleeps, timeout changes, relaxed assertions or quarantines.

Prepared in Bits Code session: https://app.datadoghq.com/code/9cbc641e-f72d-4721-a995-ecb481b53708

This PR was opened by the dd-trace Flaky-Test ROI Recommender via Bits Code.

Contributor Checklist

  • Title follows the contribution guidelines. Labels: type: bug, comp: profiling, tag: ai generated and tag: no release notes (test-only).
  • No source files were added, moved or deleted, so no CODEOWNERS change is needed.
  • No configuration flags or public documentation changes.

Jira ticket: N/A


PR by Bits - View session in Datadog

Comment @DataDog to request changes

Co-authored-by: cgcote <5115638+cgcote@users.noreply.github.com>
@datadog-datadog-us1-prod

Copy link
Copy Markdown

View session in Datadog

Bits Code status: ✅ Done

CI Auto-fix: Disabled | Enable

Comment @DataDog to request changes

@datadog-official datadog-official Bot added comp: profiling Profiling tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes Bits AI type: bug labels Nov 21, 2026
@datadog-datadog-us1-prod

Copy link
Copy Markdown

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 63.45% (+2.50%)

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

@dd-octo-sts

dd-octo-sts Bot commented Nov 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.08 s 14.05 s [-0.5%; +1.0%] (no difference)
startup:insecure-bank:tracing:Agent 12.95 s 13.11 s [-2.0%; -0.4%] (maybe better)
startup:petclinic:appsec:Agent 17.16 s 17.04 s [+0.0%; +1.4%] (maybe worse)
startup:petclinic:iast:Agent 16.93 s 17.15 s [-2.1%; -0.4%] (maybe better)
startup:petclinic:profiling:Agent 16.63 s 16.88 s [-2.6%; -0.4%] (maybe better)
startup:petclinic:sca:Agent 17.16 s 16.45 s [-0.2%; +8.8%] (no difference)
startup:petclinic:tracing:Agent 16.29 s 16.29 s [-0.9%; +0.8%] (no difference)

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

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

Bits AI comp: profiling Profiling tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants