Repository navigation
[type:perf] Speed up CI preparation and parallelize test matrices - #8271
Merged
Merged
Conversation
yuluo-yx
marked this pull request as ready for review
November 1, 2026 16:46
Aias00
approved these changes
Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and behavior
Integration jobs spend most of their time preparing runners, dependencies and services. The initial
ghsample of 50 apache/shenyu runs contained 239 jobs (190 successful, 33 skipped, 4 failed, 12 cancelled). Successful HTTP integration jobs spent a median 514.5 seconds preparing and 44.5 seconds in test/check steps; median runner queue time across successful jobs was only 2 seconds.This change reduces preparation and parallelizes the existing test inventory. It does not change application code or test assertions.
Changes
cancel-in-progress. Give non-PR runs a uniquerun_idconcurrency group so running and pending master commits cannot replace one another. Aggregate gates use!cancelled()while still checking dependency results;always()had kept an obsolete E2E run alive and delayed its successor by 308 seconds. Resource cleanup steps keep their cancellation handling.go install; use the Maven wrapper consistently. Clean runner disk only when needed and build only example modules/images deployed by each case, failing closed for unknown inputs. Do not add unrelated tool caches or delete shared remote caches.actions-timings.pyexporter with per-job queue, runner queue, preparation and verification columns. Keep cancelled/failed/skipped observations separate from successful timing samples.Measured results
All measurements below are from apache/shenyu. Workflow wall time includes scheduling and dependency waits. These are individual observations, not guaranteed speedups across runner/network variation.
Controlled original HTTP baseline versus optimized HTTP
The two runs use identical application/test sources and the same HTTP case. Each reports exactly 27 test-class result records and 103 tests, with zero failures/errors and the same 5 existing skips.
Original: https://github.com/apache/shenyu/actions/runs/41317670168
Optimized: https://github.com/apache/shenyu/actions/runs/41318728663
The original control only adds a manual timing entry point to the upstream workflow. Preparation above is job runtime minus the first-to-last JUnit execution window; it excludes queue time. The exporter itself uses API step boundaries, so its verification column can also contain compilation or deployment performed inside a test step.
First complete optimization iteration versus final revision
The first iteration already contains preparation optimizations and is not an untouched upstream baseline.
The final IT critical path is the combination case: 137 seconds building the main reactor and 264 seconds waiting for services, compared with 116 and 257 seconds in the first iteration. The higher IT time is retained in the comparison; there is no claim that every workflow became faster. Artifact upload in the CI producer decreased from 44 to 13 seconds in the measured intermediate iteration.
First iteration: CI, E2E, IT.
Latest revision
5b8f205aad9c9259e703665dc6f206ff5d34c209: all 11 workflows succeeded, with initial scheduling waits of 2-3 seconds. Latest PR checks report 91 passes and one expected skip; all required checks pass.Validation and coverage preservation
node --test .github/scripts/test-ci-workflows.mjs: 28 checks pass, including documentation scope, shard coverage without duplicates, unchanged channel combinations, startup allowance and aggregate cancellation.python3 -B .github/scripts/test-native-sql-matrix.py: 33 tests pass. New timing/example/repository Python regression tests: 16 pass. Standard-library trace line coverage is 97% for the timing exporter and 96% for the example resolver; this is not a whole-repository coverage claim../mvnw -B -ntp -pl shenyu-common -am package -DskipTests -Dmaven.javadoc.skip=truebuilds with Temurin 17 pass in 7.25 and 3.74 seconds; the second build does not recompile. These are incremental builds, not a cold-build benchmark.clean installwas not run. Publishing was not triggered; publishing workflow edits were statically validated and the build/Docker smoke workflows passed.No application migration is required. The workflow configuration replaces the existing configuration directly; reverting this PR restores the prior behavior. Shared remote caches were not deleted. Final validation: 2026-11-02 (Asia/Shanghai).