[SPARK-55993][SS][TEST] Fix flaky RocksDBStateStoreIntegrationSuite bounded memory test#54808
Open
yaooqinn wants to merge 1 commit intoapache:masterfrom
Open
[SPARK-55993][SS][TEST] Fix flaky RocksDBStateStoreIntegrationSuite bounded memory test#54808yaooqinn wants to merge 1 commit intoapache:masterfrom
yaooqinn wants to merge 1 commit intoapache:masterfrom
Conversation
…ounded memory test
The 'bounded memory usage calculation' test was flaky due to asserting
global RocksDBMemoryManager singleton state without accounting for
transient registration during streaming query initialization.
Changes:
- Remove fragile pre-query assertion (getNumRocksDBInstances(true) == 0)
that can fail if previous tests didn't fully clean up
- Wrap post-query instance count assertions in eventually{} to tolerate
transient unbounded instances during state store initialization
- Keep the same logical assertions (2 bounded, 0 unbounded) but allow
brief transient state to settle
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
What changes were proposed in this pull request?
Fix flaky test
bounded memory usage calculationinRocksDBStateStoreIntegrationSuite.The test asserts
RocksDBMemoryManager.getNumRocksDBInstances(false) == 0(no unbounded instances) immediately afterprocessAllAvailable(). However,RocksDBMemoryManageris a global singleton (object), and the streaming query may transiently register unbounded instances during state store initialization before the bounded-memory config takes full effect.Changes:
getNumRocksDBInstances(true) == 0) that can fail if previous tests did not fully clean up the global singletoneventually{}to tolerate transient registration during state store initializationWhy are the changes needed?
The test fails intermittently in CI with
1 did not equal 0at line 423, blocking unrelated PRs.Does this PR introduce any user-facing change?
No — test-only change.
How was this patch tested?
Compilation verified. The fix addresses the root cause (global singleton race) by adding retry tolerance.
Was this patch authored or co-authored using generative AI tooling?
Yes, co-authored with GitHub Copilot.