Skip to content

Improve smoke tests build-cache friendliness - #13294

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 5 commits into
masterfrom
bdu/cache-smoke-test-results
Nov 10, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 5 commits into
masterfrom
bdu/cache-smoke-test-results

Conversation

@bric3

@bric3 bric3 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

What Does This Do

Allows smoke tests to reuse matching output across commits that change only generated commit metadata. Tests continue to launch the exact packaged agent JAR.

This should be useful in particular when building smoke test fixture apps.

Apart, from other fixes, this is possible by switching the jar declared in input from the @Inputfile (which is opaque when declared this way) to @Classpath (which benefits from runtime classpath normalization already applied to dd-trace-java projects, see #11677).

Motivation

Version files having commit hash, filesystem-dependent JMX configuration ordering and oversized fixture cache entries cause misses when agent code is unchanged. This lets smoke tests benefit from the shared build cache introduced in #12604.

Additional Notes

Some numbers: All arrows compare each PR's selected master baseline -> PR run. Duration values are per-job medians.

Branch/PR Job family S3 build cache lookup hits Test tasks restored Gradle duration GitLab job duration
#12604 Smoke AMD64 (48 jobs) Not enabled -> 98.17% 0% -> 0% 8m04s -> 8m55s 20m05s -> 15m55s
#13294 Smoke AMD64 (48 jobs) 99.29% -> 99.81% 0% -> 100% (447/447) 7m22s -> 3m58s 13m02s -> 8m29s
#13294 Native smoke AMD64 (3 jobs) 99.69% -> 99.94% 0% -> 100% (5/5) 3m19s -> 1m20s 5m34s -> 3m37s
#13294 Semeru 8 debugger smoke AMD64 (1 job) 99.82% -> 99.82% 0% -> 100% (1/1) 2m42s -> 1m21s 4m37s -> 3m18s

Baselines: #12604 master 5a9bf74ccd -> warm PR run a19b40f110; #13294 master e9c3f25824 -> PR run a651611. The #12604 PR values reuse its published smoke measurements. a651611 restored all 453 executable test tasks and all five native builds.

Data context:

Master merge-base
gantt
    title Master merge-base - pipeline 151210214
    dateFormat YYYY-MM-DD HH:mm:ss
    axisFormat %H:%M:%S
    tickInterval 5minute
    todayMarker off

    section Parent pipeline
    Build and test compilation : 2000-01-01 00:00:51, 2000-01-01 00:06:46
    Instrumentation tests [48] : 2000-01-01 00:05:43, 2000-01-01 00:58:47
    Latest-dependency tests [30] : 2000-01-01 00:05:31, 2000-01-01 00:38:42
    Smoke tests AMD64 [108] : 2000-01-01 00:06:50, 2000-01-01 00:28:23
    Smoke tests ARM64 [43] : 2000-01-01 00:04:09, 2000-01-01 00:23:25
    Other Gradle tests and checks : 2000-01-01 00:00:00, 2000-01-01 00:17:47
    Packaging and system-test setup : 2000-01-01 00:03:52, 2000-01-01 00:10:27
    Startup benchmarks [2] : 2000-01-01 00:05:03, 2000-01-01 00:19:01
    Benchmark reporting and configuration validation : 2000-01-01 00:04:57, 2000-01-01 00:38:02
    Test-result aggregation and pipeline finalization : 2000-01-01 00:58:47, 2000-01-01 01:00:32
    Other jobs [376] : 2000-01-01 00:00:00, 2000-01-01 00:53:53

    section Downstream pipelines
    System tests : 2000-01-01 00:10:27, 2000-01-01 00:24:06
    Test-matrix generation : 2000-01-01 00:10:29, 2000-01-01 00:11:52
    SSI system tests : 2000-01-01 00:11:53, 2000-01-01 00:24:06

    section Comparison scale
    65-minute boundary :milestone, 2000-01-01 01:05:00, 0s
Loading

Note the pipeline on master runs many other jobs than on PRs, e.g. with other JVMs.

  • AMD64: 108 smoke jobs, elapsed duration 21m33s.
  • ARM64: 43 smoke jobs, elapsed duration 19m16s.
  • The 52 jobs matching those on the PR took 20m10s.

The Other jobs includes 144 SSI smoke jobs.

a651611: smoke-test cache implementation
gantt
    title Smoke test cache PR - pipeline 151443023
    dateFormat YYYY-MM-DD HH:mm:ss
    axisFormat %H:%M:%S
    tickInterval 5minute
    todayMarker off

    section Parent pipeline
    Build and test compilation : 2000-01-01 00:00:00, 2000-01-01 00:04:10
    Instrumentation tests [48] : 2000-01-01 00:04:21, 2000-01-01 00:16:06
    Latest-dependency tests [30] : 2000-01-01 00:03:15, 2000-01-01 00:12:48
    Smoke tests AMD64 [52] : 2000-01-01 00:04:54, 2000-01-01 00:14:57
    Other Gradle tests and checks : 2000-01-01 00:00:01, 2000-01-01 00:12:23
    Packaging and system-test setup : 2000-01-01 00:03:56, 2000-01-01 00:10:34
    Startup benchmarks [2] : 2000-01-01 00:04:50, 2000-01-01 00:18:24
    Benchmark reporting and configuration validation : 2000-01-01 00:05:15, 2000-01-01 00:22:29
    Test-result aggregation and pipeline finalization : 2000-01-01 00:26:35, 2000-01-01 00:28:22

    section Downstream pipelines
    System tests : 2000-01-01 00:10:34, 2000-01-01 00:26:33
    Test-matrix generation : 2000-01-01 00:10:35, 2000-01-01 00:12:19
    SSI system tests : 2000-01-01 00:12:19, 2000-01-01 00:26:33

    section Comparison scale
    65-minute boundary :milestone, 2000-01-01 01:05:00, 0s
Loading
Input normalisation and intended behaviour

In order to avoid discarding fingerprint when only the commit hash changed, smoke tests rely on normalization. The version is now taken from the project, which uses a stable identifier between released versions, such as 1.69.0-SNAPSHOT.

The version file write instead a version appended with ~<SHA>. With the already in-place runtime-classpath normalization, *.version paths are excluded from fingerprinting.
This should also help Gradle input normalization.

Assuming the other test inputs match:

Change Effect on smoke-test result reuse
Commit suffix inside a generated version file Fingerprint unchanged
Project version Fingerprint changes
Agent class or .classdata contents Fingerprint changes
Manifest, index or other tracked resource Fingerprint changes
ZIP entry timestamps or order Fingerprint unchanged
Filesystem traversal order of JMX configurations Packaged configuration list stays byte-identical
Presence of tracked version resources Fingerprint changes
Other excluded .version resource paths Fingerprint unchanged

Tracked version resources: dd-java-agent.version, dd-trace-api.version and trace/dd-trace-core.version. Presence changes invalidate cached results; commit-stamp changes remain normalised.

The dd-trace-java.smoke-test-app plugin uses the same mechanism with projectJar that forward a jar to the nested build.

Change to a forwarded fixture input Effect on application-build reuse
Excluded dependency commit suffix or ZIP metadata Fingerprint unchanged
Producing project's base version Fingerprint changes
Class, .classdata or other tracked resource Fingerprint changes
GraalVM release or CI builder identity Native-build fingerprint changes
Presence of tracked version resources Native-build fingerprint changes

Agent code changes will invalidate smoke tests and native builds.

Native portability and forwarded API selection
  • Quarkus and Spring use GraalVM's compatibility CPU target. The S3 prefix and builder identity separate OS/architecture, but do not distinguish host CPU features. x86-64-v3 and armv8.1-a are candidates once all eligible build and execution hosts guarantee those features.
  • Quarkus, Armeria and both native applications use project.hasProperty('apiJar') inside dependency blocks. The previous unqualified lookup checked the dependency handler and selected the published fallback despite the forwarded project property.
Approaches considered
Approach What it enables Main tradeoff
Normalise the agent input Reuse results while launching the exact packaged JAR Requires explicit handling of excluded metadata
Produce a stable smoke-test JAR Reuse results with deterministic commit metadata Most smoke tests would exercise a slightly different artifact
Separate code packaging from stamp Reuse intermediate agent packaging before adding commit data Larger build change; test reuse still needs metadata handling
Improve fixture caching Reuse application builds when agent changes require tests Application startup and test execution still run

Normalisation reuses Gradle's existing support and preserves the packaged agent exercised by smoke tests. Base-version and required-resource inputs retain the relevant invalidation rules. A separate smoke-test agent JAR and a packaging/stamping split remain outside this PR. Unused fixture dependencies are handled by #13307.

The build-cache guide covers annotations, normalisation, excluded metadata and cache-debug comparisons.

Contributor Checklist

@bric3 bric3 added comp: tooling Build & Tooling type: feature Enhancements and improvements tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes labels Nov 6, 2026
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 59.98% (+0.35%)

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

Base automatically changed from bdu/use-s3-gradle-build-cache to master November 6, 2026 18:46
@dd-octo-sts

dd-octo-sts Bot commented Nov 6, 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.04 s 14.00 s [-0.5%; +1.0%] (no difference)
startup:insecure-bank:tracing:Agent 12.91 s 12.96 s [-1.1%; +0.2%] (no difference)
startup:petclinic:appsec:Agent 17.09 s 16.99 s [-0.3%; +1.5%] (no difference)
startup:petclinic:iast:Agent 16.95 s 17.05 s [-1.3%; +0.2%] (no difference)
startup:petclinic:profiling:Agent 16.07 s 16.18 s [-6.7%; +5.4%] (unstable)
startup:petclinic:sca:Agent 17.07 s 16.88 s [+0.1%; +2.1%] (maybe worse)
startup:petclinic:tracing:Agent 16.20 s 16.27 s [-1.3%; +0.4%] (no difference)

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

@bric3
bric3 force-pushed the bdu/cache-smoke-test-results branch 2 times, most recently from a5fd6b3 to 0bf8b97 Compare November 6, 2026 20:28
@bric3

bric3 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T14:29:40.142600Z a651611 Draft marked ready
🔒 Security Review ✅ Completed 2026-11-09T14:32:08.055363Z a651611 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 0bf8b977c4

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

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

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 0bf8b977c4

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@bric3
bric3 force-pushed the bdu/cache-smoke-test-results branch 3 times, most recently from 20c7218 to 351813d Compare November 7, 2026 01:26
@bric3 bric3 changed the title Reuse smoke test results across commit metadata changes Reuse smoke test results across commits and checkouts Nov 7, 2026
@bric3
bric3 force-pushed the bdu/cache-smoke-test-results branch 13 times, most recently from f7be66e to 1191ec8 Compare November 9, 2026 09:19
@bric3
bric3 force-pushed the bdu/cache-smoke-test-results branch from 6c7346b to f582922 Compare November 9, 2026 11:19
Prevent commit hashes and filesystem traversal order changes to
invalidate the agent fingerprint (code and configuration) are unchanged,
this forced smoke tests to needlessly rerun.

Rely on runtime classpath normalisation for the agent jar input.

`dd-java-agent.version` is tracked as needed e.g. CI Visibility code
needs it to initialize itself.

Sort JMX metric configuration names before writing the packaged list so
fresh checkouts produce identical resource bytes.

Allow S3 cache entries up to 256 MiB so smoke application builds larger
than the plugin's 50 MiB default can be stored.
@bric3
bric3 force-pushed the bdu/cache-smoke-test-results branch from f582922 to 212ad4b Compare November 9, 2026 12:42
bric3 added 2 commits November 9, 2026 13:55
Makes `projectJar` API use Gradle runtime-classpath fingerprints,
this allows to leverage the existing normalization on version files.
Some jars passed to the nested smoke test app, also package the version
files, normalization helps ignore that version.

Document input annotations, normalisation and cache diagnostics in the
Gradle build-cache guide.
Use a compatibility CPU target for the Quarkus and Spring Boot native
fixtures so cached executables can run on other CI hosts of the same
OS and architecture.

Document why the S3 prefix does not isolate CPU features. Link the
GraalVM guidance and record stronger targets as candidates requiring
guarantees across eligible build and execution hosts.

Resolve forwarded API JAR properties on the project inside dependency
blocks so both native fixtures consume the supplied project JAR.
@bric3
bric3 force-pushed the bdu/cache-smoke-test-results branch from 212ad4b to a651611 Compare November 9, 2026 12:55
@bric3

bric3 commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: a651611e4d

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

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

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: a651611e4d

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@bric3
bric3 marked this pull request as ready for review November 9, 2026 14:28
@bric3
bric3 requested review from a team as code owners November 9, 2026 14:28
@bric3
bric3 requested review from dougqh and ygree and removed request for a team November 9, 2026 14:28
@bric3 bric3 changed the title Reuse smoke test results across commits and checkouts Improve smoke tests build-cache friendliness Nov 9, 2026

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 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

Commit-stamp normalization preserves separate cache invalidation for agent code, tracked resources, base versions, and required version-resource presence. Static review identified no actionable defects.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit a651611

Comment thread build-logic/smoke-test/README.md Resolved
Include dd-trace-api.version and trace/dd-trace-core.version in the
presence inputs for smoke tests and forwarded project JARs. Missing
resources change runtime versions to unknown, so adding or removing
these paths must invalidate cached results.

Keep commit stamps normalised. Cover presence changes and stamp-only
changes for all three tracked version resources in the cache tests.
Explain that normalization ignores generated `.version` file contents
while the project's base version remains a cache input.
@bric3
bric3 force-pushed the bdu/cache-smoke-test-results branch from 04f4fe1 to 60cd573 Compare November 10, 2026 10:38
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit db73247 into master Nov 10, 2026
681 of 684 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the bdu/cache-smoke-test-results branch November 10, 2026 12:21
@github-actions github-actions Bot added this to the 1.69.0 milestone Nov 10, 2026
@bric3 bric3 mentioned this pull request Nov 10, 2026
8 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: tooling Build & Tooling tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants