nevzheng opened a new pull request, #13518:
URL: https://github.com/apache/gravitino/pull/13518
### What changes were proposed in this pull request?
Reuse the selected relational database backend for all test-template methods
in a test class.
- Reset database tables before each test while retaining the class-scoped
backend.
- Rebuild poisoned fixtures after setup, lifecycle, or test failures.
- Add explicit fresh-namespace isolation for tests that modify database
structure.
- Preserve legacy per-invocation behavior when no backend lane is selected.
- Keep Docker containers alive for the complete test plan and surface
cleanup failures.
- Avoid repeated disk cleanup when an existing MySQL or PostgreSQL container
is reused.
### Why are the changes needed?
Core database tests currently recreate the relational backend and schema for
nearly every test-template invocation, even though the database server is
already shared. This dominates lane runtime.
In the matched H2 run, this change reduced backend initialization from 460
to 48 while preserving the exact 519-test identity multiset.
Fix: #6505
Depends on: #13517
Related to: #13515
### Does this PR introduce _any_ user-facing change?
No. The fixture APIs, isolation annotations, and lifecycle changes are
test-only.
### How was this patch tested?
- `./gradlew :core:spotlessApply :integration-test-common:spotlessApply`
- `./gradlew :core:coreUnitTest -PskipDockerTests=false`
- 1,970 passed, 2 skipped
- `./gradlew :core:coreH2Test -PskipDockerTests=false`
- 519 passed
- 475 unique normalized identities
- Identity digest unchanged:
`22844eb5cc3bf4e6a0d85f494bb0f4a4510e2be6a3451213ac2b5f32f382f035`
- `python3 -B -m unittest discover -s dev/ci/tests -p
'test_core_test_identity.py'`
- 9 passed
| Measurement | Before | After | Improvement |
| --- | ---: | ---: | ---: |
| Full H2 task | 324.243s | 78.034s | 4.15× faster |
| JUnit duration | 188.266s | 67.370s | 64.2% lower |
| Backend initializations | 460 | 48 | 89.6% fewer |
MySQL and PostgreSQL timing evidence will be appended after an exclusive
Docker-host validation window.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]