Skip to content

Relax Testcontainers parallelism limit from 1 to 2#12034

Open
AlexeyKuznetsov-DD wants to merge 3 commits into
masterfrom
alexeyk/test-containers-limit-2
Open

Relax Testcontainers parallelism limit from 1 to 2#12034
AlexeyKuznetsov-DD wants to merge 3 commits into
masterfrom
alexeyk/test-containers-limit-2

Conversation

@AlexeyKuznetsov-DD

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

Raises the shared testcontainersLimit build service maxParallelUsages from 1 to 2 in gradle/java_no_deps.gradle, allowing up to two Testcontainers-backed test tasks to run concurrently.

Motivation

The hard limit of 1 serialized every test task that uses Testcontainers, throttling Gradle parallelism on GitLab. Relaxing it to 2 lets more test work run in parallel and improves CI throughput.

Additional Notes

  • Conservative bump (12) to gain parallelism while keeping resource pressure (containers, memory, ports) in check.
  • No production code changes — build/CI configuration only.
  • I can see improvement of PR GitLab pipeline duration from ~55 mins -> ~46mins.

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD added tag: no release notes Changes to exclude from release notes tag: ai generated Largely based on code generated by an AI or LLM labels Jul 22, 2026
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD self-assigned this Jul 22, 2026
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD added comp: tooling Build & Tooling and removed tag: ai generated Largely based on code generated by an AI or LLM labels Jul 22, 2026
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD requested a review from bric3 July 22, 2026 14:34

@bric3 bric3 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 propose a gradle properties for that, that can be manipulated in CI if needed.


This could a good improvement if / when cointainer based tests are moved to their specific job.

Comment thread gradle/java_no_deps.gradle Outdated

ext.testcontainersLimit = gradle.sharedServices.registerIfAbsent("testcontainersLimit", TestcontainersLimitService) {
maxParallelUsages = 1
maxParallelUsages = 2

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.

suggestion: I propose to use a gradle properties for that. That way it can be controlled in CI or locally.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Make sense, I will work in this direction.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in aea624emaxParallelUsages now reads from the testcontainersMaxParallelUsages Gradle property (default 2), documented in gradle.properties, so it can be overridden in CI or locally with -PtestcontainersMaxParallelUsages=N.

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 57.37% (-0.02%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 875b30d | Docs | Datadog PR Page | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Jul 22, 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.00 s 13.82 s [+0.3%; +2.2%] (maybe worse)
startup:insecure-bank:tracing:Agent 12.89 s 12.95 s [-1.1%; +0.2%] (no difference)
startup:petclinic:appsec:Agent 16.86 s 16.63 s [+0.7%; +2.1%] (maybe worse)
startup:petclinic:iast:Agent 16.88 s 16.47 s [-1.9%; +6.8%] (no difference)
startup:petclinic:profiling:Agent 16.60 s 16.87 s [-3.0%; -0.3%] (maybe better)
startup:petclinic:sca:Agent 16.90 s 16.83 s [-0.4%; +1.3%] (no difference)
startup:petclinic:tracing:Agent 16.09 s 15.64 s [-1.2%; +7.0%] (no difference)

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

Read maxParallelUsages from the testcontainersMaxParallelUsages Gradle
property (default 2) so it can be tuned in CI or locally without a code
change, per review feedback.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD force-pushed the alexeyk/test-containers-limit-2 branch from aea624e to 875b30d Compare July 22, 2026 15:31
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD marked this pull request as ready for review July 22, 2026 15:33
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD requested a review from a team as a code owner July 22, 2026 15:33
@AlexeyKuznetsov-DD
AlexeyKuznetsov-DD requested a review from ygree July 22, 2026 15:33
@dd-octo-sts dd-octo-sts Bot added the tag: ai generated Largely based on code generated by an AI or LLM label Jul 22, 2026

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

Datadog Autotest: PASS

More details

This PR changes Testcontainers parallelism from a hardcoded limit of 1 to a configurable value with default 2, improving CI throughput by ~15% (55→46 min). The property is properly defaulted in gradle.properties, safely accessed via .toInteger(), and overridable per environment. All 28 affected modules are handled uniformly through the same build service. No behavioral regressions detected.

Was this helpful? React 👍 or 👎

📊 Validated against 8 scenarios · Open Bits AI session

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

@AlexeyKuznetsov-DD

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Jul 24, 2026

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-07-24 00:24:16 UTC ℹ️ Start processing command /merge
Use /merge -c to cancel this operation!


2026-07-24 00:24:21 UTC ℹ️ MergeQueue: pull request added to the queue

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

Use /merge -c to cancel this operation!


⏳ Merge Commit: a11e18e
Build Pipeline: 5099070477405146933

@pr-shepherd-6ad11f

Copy link
Copy Markdown

PR Shepherd is now watching this PR: fixing basic CI failures, rebasing when it falls behind, and re-queueing after transient merge-queue failures. To disable it, add the pr-shepherd:ignore label.

If you have any questions, reach the team in #ai-devx-flow.

@DataDog DataDog deleted a comment from dd-octo-sts Bot Jul 24, 2026
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD removed the tag: ai generated Largely based on code generated by an AI or LLM label Jul 24, 2026
@DataDog DataDog deleted a comment from dd-octo-sts Bot Jul 24, 2026
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD added the tag: ai generated Largely based on code generated by an AI or LLM label Jul 24, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants