Skip to content

[SPARK-56511][CORE][TESTS][FOLLOWUP] Disable off-heap memory in ShuffleExternalSorter cleanupResources test#55409

Closed
viirya wants to merge 1 commit intoapache:masterfrom
viirya:SPARK-56511-followup
Closed

[SPARK-56511][CORE][TESTS][FOLLOWUP] Disable off-heap memory in ShuffleExternalSorter cleanupResources test#55409
viirya wants to merge 1 commit intoapache:masterfrom
viirya:SPARK-56511-followup

Conversation

@viirya
Copy link
Copy Markdown
Member

@viirya viirya commented Apr 19, 2026

What changes were proposed in this pull request?

Followup to #55373.

Explicitly disable off-heap memory (spark.memory.offHeap.enabled=false) in the SparkConf used by the new "cleanupResources should not NPE when reset fails to reallocate array" test in ShuffleExternalSorterSuite.

Why are the changes needed?

The test's TaskMemoryManager override uses MemoryMode.ON_HEAP when stealing memory via acquireExecutionMemory, and the test tunes spark.testing.memory / spark.memory.fraction which only govern on-heap memory. If off-heap memory is enabled in the environment where the test runs (e.g., via a global default or driver config), the on-heap memory-stealing path may not reliably trigger the intended allocateArray() OOM, and the test can become flaky or fail to cover the regression it was introduced for.

Explicitly disabling off-heap memory in the test's SparkConf makes the setup hermetic and independent of the caller's environment, keeping the test focused on the on-heap scenario it is designed to reproduce.

Does this PR introduce any user-facing change?

No - test-only change.

How was this patch tested?

Existing test ("cleanupResources should not NPE when reset fails to reallocate array") continues to pass.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: Claude Code

@viirya viirya requested review from cloud-fan and jiangxb1987 April 19, 2026 05:42
@viirya viirya closed this Apr 20, 2026
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.

1 participant