Test spark lite heavy#1348
Open
Chandanydv1234 wants to merge 2 commits into
Open
Conversation
Chandanydv1234
force-pushed
the
test-spark-lite-heavy
branch
from
July 22, 2026 08:57
890cdc1 to
d96e9f8
Compare
sonalgoyal
requested changes
Jul 22, 2026
sonalgoyal
left a comment
Member
There was a problem hiding this comment.
instead of a static getInstance method, can you have a static attribute named isSessionInitialised just like https://www.baeldung.com/java-junit5-run-before-all-classes ?
dropped getInstance from the providers and used the isSessionInitialised flag in the extension to build the session once. made initializeSession public. memory stays the same, lite 1g and heavy 8g.
Contributor
Author
Done as suggested |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1275
What & why
Our Spark JUnits all shared one
SparkSessionProviderthat readzingg.properties, which sets the driver/executor to 8g. Only the end-to-endtests actually need that — the rest were paying for 8g for no reason. This
splits the provider into a base plus two memory profiles so unit tests can run
light.
Changes
SparkSessionProviderBase(abstract) that holds all the sessionsetup; subclasses just say which properties file to load via
getPropertiesFile().SparkSessionProviderLiteloads a newzingg-lite.properties(1g),SparkSessionProviderHeavyloadszingg-heavy.properties(8g, the old filerenamed).
TestSparkBaseLite/TestSparkBaseHeavyextensions.TestSparkBaseLite, and the two integrationexecutor tests (
TestSparkExecutorsCompound,TestSparkExecutorsSingle)onto
TestSparkBaseHeavy.SparkSessionProviderandTestSparkBase.reuseForks=falsein spark/core's surefire config. A Spark session is asingleton per JVM (
getOrCreatehands back the first one built), so without afresh JVM per test class the first class to run would fix the memory for the
rest — this keeps the 1g and 8g profiles independent.
Tests
Ran locally with
mvn -pl spark/core -am test. The provider logsSpark driver memory: X GBon startup, so the numbers below are what eachsession actually came up with:
test-compilefor spark/core + upstream modules — compiles clean.TestSparkFrame(Lite) — 1 GB — 32 run, 0 failures, 2 skipped.TestSparkExecutorsCompound(Heavy) — 8 GB — 1 run, 0 failures.TestSparkExecutorsSingle(Heavy) — 8 GB — 1 run, 0 failures.One open question
The issue says "only the integration test" for Heavy, but I put both
TestSparkExecutorsCompoundandTestSparkExecutorsSingleon Heavy since bothrun full pipelines off
configSparkIntTest.json. Happy to moveSingleback toLite if you'd rather stick to the letter of the issue.