Skip to content

[#13516] improvement(ci): Split core tests into explicit database lanes - #13517

Open
nevzheng wants to merge 6 commits into
apache:mainfrom
nevzheng:codex/13516-core-database-test-lanes
Open

nevzheng wants to merge 6 commits into
apache:mainfrom
nevzheng:codex/13516-core-database-test-lanes

Conversation

@nevzheng

@nevzheng nevzheng commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

What changes were proposed in this pull request?

This pull request splits core testing into explicit unit, H2, MySQL, and PostgreSQL lanes so each lane has independent ownership, results, timing evidence, and coverage input.

It:

  • adds dedicated Gradle tasks with single-backend selection and sequential database execution;
  • preserves legacy :core:test behavior for local compatibility;
  • records normalized test-identity manifests and reconciles the three database contracts;
  • verifies that legacy execution is the exact multiset union of the split lanes;
  • publishes separate JUnit, HTML, timing, identity, and raw JaCoCo artifacts; and
  • extends [#13459] improvement(ci): Split build and Backend IT into sharded sub-jobs #13495 with six build shards and generates one combined core coverage report from raw execution data.

Because #13495 is still open, this pull request temporarily contains its exact head commits. After #13495 merges, the branch will be rebased so this pull request contains only the #13516 delta.

Why are the changes needed?

The existing :core:test task combines unit tests with three database backends. That makes ownership, timing, failures, and coverage inputs difficult to inspect independently, and it prevents safe follow-up concurrency work.

This change establishes explicit boundaries and fail-closed equivalence checks before further database-test optimization.

Fix: #13516

Related to: #13515, #13495, #13471, and #12584.

Does this PR introduce any user-facing change?

No. There are no production API, storage-format, or user-facing configuration changes.

The new gravitino.core.test.backend system property and Gradle tasks are test-only interfaces. Legacy :core:test remains available.

How was this patch tested?

Completed locally:

  • python3 -B -m unittest discover -s dev/ci/tests -p 'test_core_test_identity.py' — 9 tests passed.
  • ./gradlew :core:spotlessCheck :core:compileTestJava -PskipWeb=true -PskipDockerTests=true
  • ./gradlew :core:coreUnitTest -PskipWeb=true -PskipDockerTests=true — 1,961 tests passed.
  • ./gradlew :core:coreH2Test -PskipWeb=true -PskipDockerTests=true — 519 tests passed.
  • Unit/H2 normalized identity intersection — zero.
  • ./gradlew rat -PskipWeb=true
  • bash -n dev/ci/test-shards.sh
  • actionlint .github/workflows/build.yml
  • Simulated merge of current upstream/main and the exact [#13459] improvement(ci): Split build and Backend IT into sharded sub-jobs #13495 head, followed by compilation and range-diff verification.

Appendix: local proof data

MySQL evidence collected so far:

  • Full coreMySQLTest lane: 519 tests executed; 518 passed and one failed during unchanged fixture teardown after its functional assertions had passed.
  • The teardown failure was a transient MySQL CommunicationsException / No route to host while dropping tables. Source and runtime inspection confirmed that the lane is serial and the affected test and teardown ordering are unchanged by this pull request.
  • Focused rerun of the affected method: 2 tests passed in 34.845 seconds (BUILD SUCCESSFUL).

PostgreSQL evidence:

  • Full corePostgreSQLTest lane: 519 tests executed; 517 passed, 2 skipped, and zero failed.
  • JUnit duration: 1,961.648 seconds. Gradle task duration: 1,977.395 seconds (32 minutes 57.395 seconds).
  • Normalized identity digest: 22844eb5cc3bf4e6a0d85f494bb0f4a4510e2be6a3451213ac2b5f32f382f035, matching the H2 lane.

TBD — four-lane identity reconciliation, legacy partition comparison, and combined JaCoCo evidence will be added when available.

Timing evidence

The comparable baseline is the successful
#13495 build (17, core) job.

CI measurement Before: combined core tests After: split core lanes
Core job wall time 49m35s Pending
Gradle step 47m47s Pending
:core:test task 45m13.251s Replaced by four lanes

The #13517 workflows stopped during startup because of the ASF action allowlist, so a comparable after-CI measurement does not exist yet.

Local split-lane evidence:

Lane Result JUnit duration Task duration
Unit 1,959 passed, 2 skipped 2m33.520s 2m38.064s
H2 519 passed 3m40.981s 6m13.684s
MySQL 518 passed, 1 teardown failure 1h09m08.839s unavailable
PostgreSQL 517 passed, 2 skipped 32m41.648s 32m57.395s

The focused rerun of the MySQL teardown case passed both invocations.

Using the four local JUnit durations, the modeled serial total is 1h48m04.988s and the ideal concurrent critical path is 1h09m08.839s. This represents 38m56.149s, or 36.0%, of idealized local elapsed-time reduction—a 1.56× speedup. This is parallelization headroom, not an observed CI before/after result.

yuqi1129 and others added 6 commits September 23, 2026 11:16
…the aggregate result jobs

- Fold the `client` Backend IT shard into `others`. Both are short, and the
  merged shard still finishes before the slowest build shard, so PR feedback
  time is unchanged while each backend runs one job less.
- Remove `build-result` and `BackendIT-result`. No branch protection rule
  requires them, so they only added checks.
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.

[Subtask] Split core tests into explicit database lanes

2 participants