Skip to content

Reduce wait time for test job to run as soon as their needed build job is finished#11470

Open
bric3 wants to merge 1 commit into
masterfrom
codex/tune-gitlab-test-needs
Open

Reduce wait time for test job to run as soon as their needed build job is finished#11470
bric3 wants to merge 1 commit into
masterfrom
codex/tune-gitlab-test-needs

Conversation

@bric3
Copy link
Copy Markdown
Contributor

@bric3 bric3 commented May 27, 2026

What Does This Do

Narrows selected GitLab tests-stage jobs from needs: [ build_tests ] to needs:parallel:matrix entries that point at the matching build_tests matrix row.

This covers the base, profiling, instrumentation, latest-dependency instrumentation, smoke, and muzzle jobs that have a build matrix counterpart. Jobs without a direct counterpart keep the inherited default dependency behavior.

Screenshot 2026-05-27 at 17 32 24 Screenshot 2026-05-27 at 17 34 36

Motivation

Test jobs were only started when all tests have been built. Allowing to run test jobs sooner reduces the feedback loop.

Technically a needs entry that references a parallel matrix job waits for every generated job in that matrix by default.

Using needs:parallel:matrix lets each mapped test job wait only for the build row it actually needs.

Relevant GitLab docs:

Additional Notes

Later, we'll run on GitLab 18.6 or later, matrix expressions could reduce the static repetition here in a future cleanup. In particular, $[[ matrix.IDENTIFIER ]] can express 1:1 dependencies between parallel matrix jobs at pipeline creation time, if the downstream job matrix carries the same selector identifiers.

Docs: https://docs.gitlab.com/ci/yaml/matrix_expressions/

@bric3 bric3 added comp: tooling Build & Tooling type: enhancement Enhancements and improvements tag: no release notes Changes to exclude from release notes tag: ai generated Largely based on code generated by an AI or LLM labels May 27, 2026 — with ChatGPT Codex Connector
@bric3 bric3 marked this pull request as ready for review May 27, 2026 15:40
@bric3 bric3 requested a review from a team as a code owner May 27, 2026 15:40
@bric3 bric3 requested review from AlexeyKuznetsov-DD and removed request for a team May 27, 2026 15:40
@bric3 bric3 changed the title Limit GitLab test build dependencies Reduce wait time for test job to run as soon as their needed build job is finished May 27, 2026
@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented May 27, 2026

🟢 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

Startup Time

Scenario This PR master Change
insecure-bank / iast 13,923 ms 13,847 ms +0.5%
insecure-bank / tracing 12,852 ms 12,939 ms -0.7%
petclinic / appsec 15,578 ms 16,319 ms -4.5%
petclinic / iast 16,533 ms 16,590 ms -0.3%
petclinic / profiling 16,507 ms 16,357 ms +0.9%
petclinic / tracing 15,936 ms 15,867 ms +0.4%

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

Copy link
Copy Markdown
Contributor

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD left a comment

Choose a reason for hiding this comment

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

Cool!
Maybe worth to add some comments explaining that feature?
left minor comments about unused anchors...

Comment thread .gitlab-ci.yml

test_base:
extends: .test_job
needs: &needs_build_tests_base
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.

There is no usage of this anchor, do wee need it?

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.

Unsure, thx I'll take a look at that!

Comment thread .gitlab-ci.yml

test_inst_latest:
extends: .test_job_with_test_agent
needs: &needs_build_tests_latestdep
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.

Same here, not reused.

Comment thread .gitlab-ci.yml

test_profiling:
extends: .test_job
needs: &needs_build_tests_profiling
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.

Not reused too.

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: enhancement Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants