Skip to content

Capture Testcontainers image pull diagnostics - #12819

Draft
AlexeyKuznetsov-DD wants to merge 6 commits into
masterfrom
alexeyk/testcontainers-image-pull-logs
Draft

AlexeyKuznetsov-DD wants to merge 6 commits into
masterfrom
alexeyk/testcontainers-image-pull-logs

Conversation

@AlexeyKuznetsov-DD

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

What Does This Do

Enable Testcontainers' tc.<image> logger in the instrumentation test harness and preserve image-pull diagnostics in UTC-stamped files, separated by test task and worker. Capture pull starts, layer download/extraction progress, retries, stalls, completion time, and local-cache decisions across test retries and logging resets.

Publish build/reports/docker-images/<test-task>/image-pulls-<worker-pid>.log files as individual CI artifacts and through the existing report archive. Dedicated logs exclude container output, Docker command arguments, authentication diagnostics, and exception bodies. The diagnostic output path does not affect portable test cache keys.

Motivation

The harness enables org.testcontainers at DEBUG but keeps the root logger at WARN. Testcontainers writes pull progress through the separate tc.<image> logger, so the useful pull timeline is suppressed. A failed image resolution followed by a passing retry consequently leaves no evidence of layer progress or how long the successful pull took.

Additional Notes

Observed for basic statement on sqlserver with null generates spans:

ContainerLaunchException: Container startup failed for image <SQL Server image>
Caused by: ContainerFetchException: Can't get Docker image
Caused by: ConditionTimeoutException: ... was not fulfilled within 2 minutes.

The first test execution failed after 240.507 seconds; the same test passed on retry in 8.905 seconds. Those are whole-test durations, not measured pull durations. A later execution explicitly used the locally cached image. This change preserves the missing pull timeline for future investigations; it does not change pull timeouts or collect Docker daemon activity after a client timeout.

Related precedent: Track Testcontainers images as Gradle test inputs (#12633) and Relax Testcontainers image pull timeouts (#12777).

Validation: two focused tests passed:

  • ./gradlew :utils:test-utils:test --tests datadog.trace.test.logging.TestcontainersImageLoggingTest verifies progress/retry/stall/cache events, UTC timestamps, append behavior after logging resets, duplicate prevention, and exclusion of unrelated output and exception bodies.
  • ./gradlew -p build-logic :testcontainers:test --tests '*TestcontainersPluginTest.one can write Groovy DSL dependency' verifies task-specific log directories and configuration-cache reuse.

./gradlew :dd-java-agent:instrumentation-testing:compileGroovy passed, and CI YAML parses. A real Docker pull and CI artifact upload have not yet been exercised.

Performance and technical-debt review: checked, no issue; changes are confined to test/build infrastructure.

Contributor Checklist

Jira ticket: N/A — test diagnostics.

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD added type: feature Enhancements and improvements comp: testing Testing tag: no release notes Changes to exclude from release notes tag: diagnostics Diagnostics related changes comp: tooling Build & Tooling tag: ai generated Largely based on code generated by an AI or LLM labels Oct 9, 2026
@datadog-datadog-prod-us1

This comment has been minimized.

@dd-octo-sts

dd-octo-sts Bot commented Oct 9, 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.95 s 14.02 s [-1.2%; +0.2%] (no difference)
startup:insecure-bank:tracing:Agent 12.86 s 12.92 s [-1.2%; +0.2%] (no difference)
startup:petclinic:appsec:Agent 17.67 s 17.44 s [+0.3%; +2.3%] (maybe worse)
startup:petclinic:iast:Agent 16.81 s 17.47 s [-8.1%; +0.5%] (no difference)
startup:petclinic:profiling:Agent 17.23 s 16.65 s [-0.9%; +7.8%] (no difference)
startup:petclinic:sca:Agent 17.47 s 17.46 s [-1.0%; +1.0%] (no difference)
startup:petclinic:tracing:Agent 16.02 s 16.63 s [-7.8%; +0.4%] (no difference)

Commit: 6acf9163 · 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

comp: testing Testing comp: tooling Build & Tooling tag: ai generated Largely based on code generated by an AI or LLM tag: diagnostics Diagnostics related changes 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.

1 participant