Skip to content

[Cherry-pick to branch-1.3] [#12583] improvement(ci): Optimize build test execution (#12584) - #12703

Merged
jerryshao merged 1 commit into
apache:branch-1.3from
yuqi1129:cherry-pick-12584-to-branch-1.3
Aug 28, 2026
Merged

[Cherry-pick to branch-1.3] [#12583] improvement(ci): Optimize build test execution (#12584)#12703
jerryshao merged 1 commit into
apache:branch-1.3from
yuqi1129:cherry-pick-12584-to-branch-1.3

Conversation

@yuqi1129

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Backport #12584 to branch-1.3.

  • Write Gradle test reports to task-specific directories.
  • Serialize tests sharing Docker resources.
  • Limit the build job to two Gradle workers.
  • Raise the build timeout from 90 to 120 minutes.

Why are the changes needed?

Reduce the build critical path and avoid CI build timeouts on branch-1.3.

Fix: #12583

Does this PR introduce any user-facing change?

No.

How was this patch tested?

  • ./gradlew --no-daemon help --max-workers=2 -PskipWeb=true
  • git diff --check

Cherry-pick information

  • Original commit: a80f6fd2e70c5d9e76ed98b3fbae706533687740
  • Target branch: branch-1.3
  • Status: Clean cherry-pick

…#12584)

### What changes were proposed in this pull request?

- Write each Gradle test report to a task-specific directory so
independent test tasks can run in parallel.
- Serialize projects containing Docker-tagged tests through a shared
Gradle build service because they share containers and other test
resources.
- Limit the build job to two Gradle workers to avoid CPU and memory
contention between test JVMs.
- Raise the build job timeout from 90 to 120 minutes.

### Why are the changes needed?

The build job frequently approaches or exceeds its 90-minute timeout.
Gradle parallel execution is enabled, but the shared test report
directory forces all test tasks to run one at a time. Docker-based tests
cannot all be made parallel because several projects share servers,
databases, containers, and configuration files.

### Measured result

The serial baseline ([run
32871678601](https://github.com/apache/gravitino/actions/runs/32871678601/job/97880344037))
executed 62 test tasks with a maximum concurrency of one:

| Metric | Serial baseline |
|---|---:|
| Sum of test task durations | 68.43 min |
| First test start to last test end | 69.65 min |
| `Build with Gradle` | 70.03 min |
| Complete build job | 78.33 min |

Three successful revisions of this PR with `--max-workers=2` produced
consistent results ([run
32729975754](https://github.com/apache/gravitino/actions/runs/32729975754/job/97439835322),
[run
32823784437](https://github.com/apache/gravitino/actions/runs/32823784437/job/97727370085),
and [run
32833427151](https://github.com/apache/gravitino/actions/runs/32833427151/job/97769263031)):

| Metric | Two workers |
|---|---:|
| Maximum concurrent test tasks | 2 |
| Sum of test task durations | 70.19–70.96 min |
| First test start to last test end | 63.04–63.79 min |
| `Build with Gradle` | 63.43–64.13 min |
| Complete build job | 72.52–76.58 min |

This reduces the test and Gradle critical path by about six minutes, or
8–9%. Complete job time varies more because `publishToMavenLocal` alone
varied from about 5 to 12 minutes across these runs.

An experiment without the worker limit ([run
32943743979](https://github.com/apache/gravitino/actions/runs/32943743979/job/98100012872))
allowed four concurrent test tasks, but increased their summed duration
to 82.07 minutes and the test wall time to 68.32 minutes. The Gradle
step regressed to 68.83 minutes because resource contention offset most
of the additional parallelism. The two-worker limit is therefore
retained.

### Remaining bottleneck

Twenty-two test tasks must still hold the shared Docker lock and account
for roughly 61–62 minutes with two workers. `:core:test` is the largest
part of that chain. A material reduction beyond this PR requires
sharding the Docker-heavy tests across separate runners and aggregating
their coverage reports.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

- Verified from three CI runs that independent test tasks reach a
concurrency of two while Docker-locked tasks remain serialized.
- Verified the uncapped run reaches four concurrent test tasks and
regresses due to resource contention.
- Ran `gradle help --max-workers=2 -PskipWeb=true` successfully with
proxies disabled.
- Ran `git diff --check`.

(cherry picked from commit a80f6fd)
Copilot AI lite review requested due to automatic review settings August 28, 2026 03:53

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

Code Coverage Report

Overall Project 67.68% 🟢
Files changed No Java source files changed -

Module Coverage
aliyun 1.72% 🔴
api 47.73% 🟢
authorization-common 85.96% 🟢
aws 42.04% 🟢
azure 2.47% 🔴
catalog-common 10.4% 🔴
catalog-fileset 80.23% 🟢
catalog-glue 68.95% 🟢
catalog-hive 79.42% 🟢
catalog-jdbc-clickhouse 81.67% 🟢
catalog-jdbc-common 45.48% 🟢
catalog-jdbc-doris 82.36% 🟢
catalog-jdbc-hologres 54.03% 🟢
catalog-jdbc-mysql 79.33% 🟢
catalog-jdbc-oceanbase 78.6% 🟢
catalog-jdbc-postgresql 83.39% 🟢
catalog-jdbc-starrocks 79.16% 🟢
catalog-kafka 77.01% 🟢
catalog-lakehouse-generic 59.18% 🟢
catalog-lakehouse-hudi 79.1% 🟢
catalog-lakehouse-iceberg 85.86% 🟢
catalog-lakehouse-paimon 82.14% 🟢
catalog-model 77.72% 🟢
cli 44.51% 🟢
client-java 77.99% 🟢
common 50.75% 🟢
core 82.68% 🟢
filesystem-hadoop3 77.3% 🟢
flink 0.0% 🔴
flink-common 47.12% 🟢
flink-runtime 0.0% 🔴
gcp 14.12% 🔴
hadoop-common 10.88% 🔴
hive-metastore-common 53.77% 🟢
iceberg-aliyun-bundle 0.0% 🔴
iceberg-common 58.15% 🟢
iceberg-rest-server 73.9% 🟢
idp-basic 86.02% 🟢
integration-test-common 0.0% 🔴
jobs 66.17% 🟢
lance-common 24.42% 🔴
lance-rest-server 60.13% 🟢
lineage 53.02% 🟢
optimizer 82.95% 🟢
optimizer-api 21.95% 🔴
server 86.46% 🟢
server-common 76.03% 🟢
spark 28.57% 🔴
spark-common 41.66% 🟢
trino-connector 40.29% 🟢

@jerryshao
jerryshao merged commit c922c80 into apache:branch-1.3 Aug 28, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants