Skip to content

[MINOR] [CORE] [TESTS] Fix flaky DAGSchedulerSuite test for push-based shuffle#55221

Closed
dbtsai wants to merge 2 commits intoapache:masterfrom
dbtsai:dagscheduler-flaky-fix
Closed

[MINOR] [CORE] [TESTS] Fix flaky DAGSchedulerSuite test for push-based shuffle#55221
dbtsai wants to merge 2 commits intoapache:masterfrom
dbtsai:dagscheduler-flaky-fix

Conversation

@dbtsai
Copy link
Copy Markdown
Member

@dbtsai dbtsai commented Apr 6, 2026

What changes were proposed in this pull request?

Add sc.listenerBus.waitUntilEmpty() before the completedStage assertion in the push-based shuffle test in DAGSchedulerSuite.

Why are the changes needed?

The test was intermittently failing due to a race condition. SparkListenerStageCompleted events are delivered asynchronously through the
listener bus, so the completedStage assertion could execute before the event was processed, causing a spurious failure. Waiting for the
listener bus to drain before asserting eliminates the race.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Existing test in DAGSchedulerSuite. The fix removes a race condition rather than adding new test logic.

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

Generated-by: Claude Sonnet 4.6 (Claude Code)

dbtsai added 2 commits April 6, 2026 08:29
Add sc.listenerBus.waitUntilEmpty() before the completedStage assertion
to ensure the async listener bus has processed the stage completion event
before we check it.

Co-authored-by: DB Tsai <dbtsai@dbtsai.com>
@dbtsai dbtsai closed this in c7c78e0 Apr 7, 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