Skip to content

[MINOR][TESTS] Add catch-all case to non-total onOtherEvent in test listeners - #57618

Closed
haoyangeng-db wants to merge 1 commit into
apache:masterfrom
haoyangeng-db:minor-sparklistener-onotherevent-catchall
Closed

[MINOR][TESTS] Add catch-all case to non-total onOtherEvent in test listeners#57618
haoyangeng-db wants to merge 1 commit into
apache:masterfrom
haoyangeng-db:minor-sparklistener-onotherevent-catchall

Conversation

@haoyangeng-db

Copy link
Copy Markdown
Contributor

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.

@uros-b

uros-b commented Jul 29, 2026

Copy link
Copy Markdown
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
haoyangeng-db force-pushed the minor-sparklistener-onotherevent-catchall branch from f5a4d8b to eea3a44 Compare July 29, 2026 19:07
@cloud-fan cloud-fan closed this in 0caba76 Jul 30, 2026
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>
@cloud-fan

Copy link
Copy Markdown
Contributor

Merge Summary:

Posted by merge_spark_pr.py

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.

3 participants