Skip to content

Build: Speed up Spark CI with parallel test execution#16357

Open
kevinjqliu wants to merge 5 commits into
apache:mainfrom
kevinjqliu:kevinjqliu/parallelize-spark-ci
Open

Build: Speed up Spark CI with parallel test execution#16357
kevinjqliu wants to merge 5 commits into
apache:mainfrom
kevinjqliu:kevinjqliu/parallelize-spark-ci

Conversation

@kevinjqliu
Copy link
Copy Markdown
Contributor

@kevinjqliu kevinjqliu commented May 15, 2026

Cuts Spark CI walltime from ~84 min to ~58 min (−31%) on apache/iceberg main, validated empirically on this branch.

Changes

  • Split matrix on tests: [core, extensions]. iceberg-spark, -extensions, and -runtime previously ran serially in one job. Splitting them into two concurrent jobs cuts the critical path from ~86 min (full suite) to ~58 min (longest single leg). Doubles the matrix from 10 → 20 jobs.

  • -DtestParallelism=auto. Runs Gradle test workers in parallel. On ubuntu-24.04 (4 vCPU) auto resolves to 2 forks per JVM. Empirically this is the dominant per-job speedup; no test stability issues observed.

  • max-parallel: 1520. With 20 matrix cells, capping at 15 queues 5 jobs into a second wave (simulated ~87 min walltime — worse than baseline). 20 is the Apache infra policy ceiling and lets the full matrix run in a single wave.

  • timeout-minutes: 90. Catches hangs (we hit one during this work) instead of burning the GitHub default 360 min. ~30 min headroom above the observed max job (60 min).

  • Removed jlumbroso/free-disk-space. ubuntu-24.04 starts with ~88 GB free; Spark CI never approaches that. Confirmed no ENOSPC failures across 20+ recent main runs. Saves ~1–2 min per job.

  • Artifact name includes matrix.tests; retention-days: 7. Required to avoid collisions on upload-artifact@v7 with the split matrix. Short retention keeps storage bounded across 20 jobs × every PR push.

Validation

Baseline = last 20 successful spark-ci.yml runs on apache/iceberg main (170 jobs sampled, pre-change config: max-parallel: 15, 10-cell matrix, full suite per job).
This PR = run 25965870161 on head 47507cda.

Metric Baseline (main) This PR Δ
Walltime 84 min 58 min −26 min (−31%)
Critical-path job 86 min (p99), 83 min (p95) 58 min −28 min (−33%)
Median job 78 min 42 min −36 min (−46%)
Jobs in matrix 10 20 +10
Job concurrency 15 20 +5

Critical path: spark-tests (17, 4.0, 2.13, core) at 58.0 min. All 20 jobs started within 3 s of run start — max-parallel: 20 runs the full matrix in a single wave with no queueing.

This comment was marked as outdated.

@kevinjqliu kevinjqliu force-pushed the kevinjqliu/parallelize-spark-ci branch from e735e89 to 7350fea Compare May 16, 2026 05:05
@kevinjqliu kevinjqliu force-pushed the kevinjqliu/parallelize-spark-ci branch from b932d56 to fdefde6 Compare May 16, 2026 16:45
@kevinjqliu kevinjqliu requested a review from Copilot May 16, 2026 17:55
@kevinjqliu kevinjqliu marked this pull request as ready for review May 16, 2026 17:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/spark-ci.yml Outdated
Comment thread .github/workflows/spark-ci.yml Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants