[MINOR][TESTS] Add catch-all case to non-total onOtherEvent in test listeners - #57618
Closed
haoyangeng-db wants to merge 1 commit into
Closed
[MINOR][TESTS] Add catch-all case to non-total onOtherEvent in test listeners#57618haoyangeng-db wants to merge 1 commit into
haoyangeng-db wants to merge 1 commit into
Conversation
uros-b
approved these changes
Jul 29, 2026
Member
|
LGTM, thank you @haoyangeng-db |
…isteners Add a catch-all `case _ =>` as the final arm to a few SparkListener.onOtherEvent match blocks in test suites that enumerate only the specific event type(s) they care about and omit a catch-all: PluginContainerSuite, SQLExecutionSuite (jobTags / jobGroupId tests), and SparkConnectServiceInternalServerSuite. SparkListenerBus.doPostEvent routes every non-built-in event to onOtherEvent, so a shared-queue listener receives all such events, not just the ones it enumerates. A match block with no `case _ =>` throws a scala.MatchError on every other event; ListenerBus.postToAll logs and swallows it, so tests pass but the logs are spammed with MatchError stack traces. The catch-all matches the convention the built-in listeners already follow and is always added last, so it never shadows an existing case. No behavior change; test-only.
haoyangeng-db
force-pushed
the
minor-sparklistener-onotherevent-catchall
branch
from
July 29, 2026 19:07
f5a4d8b to
eea3a44
Compare
cloud-fan
pushed a commit
that referenced
this pull request
Jul 30, 2026
…st listeners ### What changes were proposed in this pull request? Add a catch-all `case _ =>` as the final arm to a few SparkListener.onOtherEvent match blocks in test suites that enumerate only the specific event type(s) they care about and omit a catch-all: PluginContainerSuite, SQLExecutionSuite (jobTags / jobGroupId tests), and SparkConnectServiceInternalServerSuite. ### Why are the changes needed? SparkListenerBus.doPostEvent routes every non-built-in event to onOtherEvent, so a shared-queue listener receives all such events, not just the ones it enumerates. A match block with no `case _ =>` throws a scala.MatchError on every other event; ListenerBus.postToAll logs and swallows it, so tests pass but the logs are spammed with MatchError stack traces. The catch-all matches the convention the built-in listeners already follow and is always added last, so it never shadows an existing case. ### How was this patch tested? This change is test-only. ### Was this patch authored or co-authored using generative AI tooling? Co-authored w/ Claude Code. Closes #57618 from haoyangeng-db/minor-sparklistener-onotherevent-catchall. Authored-by: haoyangeng-db <haoyan.geng@gmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com> (cherry picked from commit 0caba76) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
Contributor
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?
Add a catch-all
case _ =>as the final arm to a few SparkListener.onOtherEvent match blocks in test suites that enumerate only the specific event type(s) they care about and omit a catch-all: PluginContainerSuite, SQLExecutionSuite (jobTags / jobGroupId tests), and SparkConnectServiceInternalServerSuite.Why are the changes needed?
SparkListenerBus.doPostEvent routes every non-built-in event to onOtherEvent, so a shared-queue listener receives all such events, not just the ones it enumerates. A match block with no
case _ =>throws a scala.MatchError on every other event; ListenerBus.postToAll logs and swallows it, so tests pass but the logs are spammed with MatchError stack traces. The catch-all matches the convention the built-in listeners already follow and is always added last, so it never shadows an existing case.How was this patch tested?
This change is test-only.
Was this patch authored or co-authored using generative AI tooling?
Co-authored w/ Claude Code.