chihsuan opened a new pull request, #10424:
URL: https://github.com/apache/ozone/pull/10424
## What changes were proposed in this pull request?
`TestOmSnapshot` is an abstract `@TestInstance(PER_CLASS)` base whose 8
concrete subclasses each
spin up their own `MiniOzoneCluster` and re-run the whole suite, varying
`(bucketLayout, enableFileSystemPaths, forceFullSnapshotDiff,
disableNativeDiff, createLinkedBucket)`.
Every test method is therefore paid up to 8 times, even when it exercises no
config-specific code.
Four config-independent heavyweight tests are responsible for a
disproportionate share of that cost.
This change pins each of them to run in exactly one existing subclass (via
an `assumeTrue(...)` guard at
the top of the method) so it executes once and fast-skips in the other 7:
- `testSnapshotCompactionDag` runs only in `TestOmSnapshotFsoWithNativeLib`.
It needs native-on (the
SST-pruning verification block is guarded by `if (!disableNativeDiff)`),
and FSO is the richest layout
for it: keys under `/dir1/dir2/dir3/...` populate `directoryTable` +
`fileTable` (both tracked in the
compaction DAG), whereas OBJECT_STORE/LEGACY only populate `keyTable`.
Native-on is a strict superset of
native-off here, so coverage is preserved.
- `testCompactionDagDisableForSnapshotMetadata`,
`testSnapshotOpensWithDisabledAutoCompaction` and
`testSnapshotReuseSnapName` run only in
`TestOmSnapshotFsoWithoutNativeLib` (the native-off class, so they
keep running in local environments without the native lib).
No new test class, no base-class extraction, no new cluster bring-up: each
pinned test runs in a subclass
that already builds its cluster. The methods stay physically in
`TestOmSnapshot` and remain inherited, so
they simply report as skipped in the other classes.
A small private helper `assumeCanonicalConfig(boolean requiresNativeDiff)`
keeps the two guard conditions
readable; each resolves to a unique subclass.
Trade-off: after this change `testSnapshotCompactionDag` no longer runs
under OBJECT_STORE/LEGACY, and a
contributor running locally without the native lib will not exercise it (its
pinned class is native-gated).
CI is unaffected (it has the native lib). This matches how the existing
`*WithNativeLib*` classes already
behave locally.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-10308
## How was this patch tested?
Existing tests; this is a test-only change that relocates where four methods
execute, not what they assert.
Verified on CI by comparing the `integration (snapshot)` job of the branch
run against `apache/ozone`
master HEAD on the same `build-branch` workflow:
- Both runs: zero failures/errors. Skip pattern moved exactly as intended
(master FSO=0 / OS-Legacy=12 ->
branch 3 / 1 / 4 / 4 / 16x4), i.e. `compactionDag` runs in exactly one
class and the three lifecycle tests
in exactly one, all others skip.
- The 8-class `TestOmSnapshot` matrix dropped from 2046.8s to 1815.3s (about
-231.5s, ~3.9 min); the whole
snapshot job from 2884s to 2651s (~3.9 min, ~8%). Measured `compactionDag`
cost on CI is ~34s/occurrence.
Also ran the native-off pinned class locally (no native lib):
`TestOmSnapshotFsoWithoutNativeLib` reports the
three lifecycle tests passing and `compactionDag` skipped, as designed.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]