[SDTEST-3832] Add target time parallelism setting#102
Conversation
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 20519dc | Docs | Datadog PR Page | Give us feedback! |
There was a problem hiding this comment.
More details
The selection algorithm correctly tracks best (globally optimal by score) and targetBest (best meeting target) as independent variables, so bestWithoutTarget is always the true global optimum even when a different split is chosen to satisfy the target. Boundary conditions (exact equality at target, fallback with warning when unreachable, targetTime=0 disabled path, single-candidate edge case) all behave as designed across 11 adversarial scenarios.
📊 Validated against 11 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit 4b3b3f6 · What is Autotest? · Any feedback? Reach out in #autotest
E2E Test Report: SUCCESSTested by: Shepherd Agent (autonomous QA for Datadog Test Optimization) Test Environment
Results
Issues FoundNo product issues found. During the retest I first tried to pin crook to the raw commit SHA, but crook builds test runners using VerificationDatadog UI verification was not applicable for this change because the validation used Test Methodology
This E2E test was performed by Shepherd - autonomous QA for Datadog Test Optimization. |
What
Adds a
--target-time/DD_TEST_OPTIMIZATION_RUNNER_TARGET_TIMEduration setting for the parallelism calculator. When configured, DDTest first chooses among candidate splits whose expected wall time is at or below the target. If none can satisfy the target within the min/max parallelism range, it warns and selects the split with the lowest expected wall time, ignoring CI job overhead, to get as close as possible to the target.The plan report now explains split selection: selected split, target-time status, modeled CI overhead, selection score, what DDTest would choose without target time, and the best five candidate splits by score.
Example report:
Why
Customers need a way to bias DDTest toward a wall-time goal while still understanding the cost of that choice. Showing the modeled CI overhead (
runners x configured CI job overhead) and the no-target alternative makes the consequences of selecting a target time visible in the plan output.When the target cannot be reached, the best outcome is to minimize actual wall time rather than optimize the score that includes CI overhead, because the configured target means the user is asking DDTest to get as close as possible to that wall-time goal.
E2E testing
Manual scenario: run
ddtest plan --min-parallelism 1 --max-parallelism 8 --target-time 5m --ci-job-overhead 30son a repository with known test suite durations. Confirm.testoptimization/runner/parallel-runners.txtcontains the selected runner count, and confirm the plan report includes theSplit selectionsection with the selected split, no-target alternative, modeled CI overhead, and up to five candidates sorted by score.Also run with an unreachable target, such as
--target-time 30sfor a suite whose fastest split is above 30s. Confirm DDTest logs a target-time warning and selects the split with the lowest expected wall time.