[MINOR] Split ITConversionController so its tests can use the fork pool - #883
[MINOR] Split ITConversionController so its tests can use the fork pool#883slachiewicz wants to merge 1 commit into
Conversation
Failsafe is configured with reuseForks=false, so a test class occupies
exactly one fork and its tests run serially there no matter how high
forkCount is. ITConversionController held 13 test methods expanding to
44 invocations, and at 1003s it was the single longest thing in the
build - xtable-core takes 18:05 of a 27:22 CI run, and the class alone
accounts for most of that. No amount of extra forks, caching or runner
capacity can shorten it while it is one class.
Move the shared Spark fixture and the assertion helpers into a new
abstract ConversionControllerTestBase and split the tests across five
classes grouped by what they exercise:
ITConversionController testVariousOperations
ITConversionControllerIncrementalSync time travel, single-format,
out-of-sync, no-op, retention
ITConversionControllerSchemaEvolution UUID columns, Delta column
mapping, snapshot recovery
ITConversionControllerConcurrentWrites concurrent inserts, compaction
ITConversionControllerPartitioning partition transforms
Test bodies and assertions are unchanged; 13 methods and 44 invocations
before and after. The base class is deliberately named so that it
matches neither failsafe's IT* includes nor surefire's *Test patterns.
Each class gets its own JVM and therefore its own SparkSession, which
costs a little startup per class but lets the existing forks run the
groups concurrently.
|
Closing this — the CI run on this PR shows it makes the build slower, not faster, so the premise behind it is wrong. Leaving the measurement here since the result is useful on its own.
The reduced The decisive part is what happened to classes this PR does not touch at all: Untouched tests do not get 20-46% slower because of a refactor elsewhere. That is resource contention. What I got wrongI read
Possibly worth trying insteadIf the runner really is oversubscribed, the useful direction is the opposite of this PR: lowering Otherwise the levers that reduce total work rather than rearranging it: a larger runner if ASF infra offers one for this project, or #882, which lets unchanged modules skip their build and tests entirely. |
What is the purpose of the pull request
ITConversionControlleris the single longest-running thing in CI, and because of how failsafe is configured it cannot be shortened by any amount of extra hardware.The root pom sets
reuseForks=falsealongsideforkCount=6. That means a test class occupies exactly one fork and its tests run serially inside it —forkCountparallelises across classes, never within one.ITConversionControllerheld 13 test methods expanding to 44 invocations, and in a recent run it reported:For context, in that same run
XTable Project Coretook 18:05 of a 27:22 total, and the next-longest test classes are well below the 1003s mark (ITDeltaConversionSource684s,ITHudiConversionSource635s). So this one class sets the floor for the whole build: more forks, a bigger runner, or build caching cannot move it.Brief change log
ConversionControllerTestBase, an abstract class holding the shared Spark fixture (@BeforeAll/@AfterAll), thecheckDatasetEquivalenceoverloads, the UUID comparison helper, the partition argument builders andgetTableSyncConfigITConversionControllertestVariousOperationsITConversionControllerIncrementalSyncITConversionControllerSchemaEvolutionITConversionControllerConcurrentWritesITConversionControllerPartitioningTest bodies and assertions are unchanged — this is a move, not a rewrite. 13 methods and 44 invocations before and after.
The base class is named
ConversionControllerTestBaseon purpose: it matches neither failsafe's**/IT*.javaincludes nor surefire's**/*Test.javapatterns, so it is not collected as a test class in its own right.Each class gets its own JVM and therefore its own
SparkSession. That costs a little startup per class, which is the trade being made for letting the existing forks run the groups concurrently.Verify this pull request
This pull request is already covered by existing tests — it is a reorganisation of them.
Verified locally on Temurin 11 with the project's wrapper:
./mvnw -pl xtable-core verify -Dit.test='ITConversionController*'reportsTests run: 44, the same count as the class before the splitRunning org.apache.xtable.ITConversionControllerline with everything serialised behind itspotless:checkandapache-rat:checkpassExpected effect, and its limit
I want to be precise rather than optimistic here.
testVariousOperationsis roughly 64% of the original class's test time, so after the split the largest piece lands around 640s. That is just belowITDeltaConversionSourceat 684s, which then becomes the binding constraint forxtable-core.So the expected shape is
xtable-coreroughly 18:05 → ~11:30, and the total build roughly 27:22 → ~21:00. SplittingtestVariousOperationsany further would not help untilITDeltaConversionSourceandITHudiConversionSourceare split too — which is why this PR stops where it does.Those are model-based numbers from per-class timings, not a measurement; the CI run on this PR is the real check, and I am happy to post the observed
XTable Project Coretime here once it completes.