This is an automated email from the ASF dual-hosted git repository.
dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push:
new eb2adde2f2db [SPARK-54835][SQL][TESTS][FOLLOWUP] Drain listener bus
before registering listener in test
eb2adde2f2db is described below
commit eb2adde2f2dbb940bd2f683561f10573e2b7cb3b
Author: Wenchen Fan <[email protected]>
AuthorDate: Fri Feb 20 09:50:43 2026 -0800
[SPARK-54835][SQL][TESTS][FOLLOWUP] Drain listener bus before registering
listener in test
### What changes were proposed in this pull request?
This is a followup to #53596. In the test "CTAS/RTAS should trigger two
query executions", we drain the listener bus before registering the
`QueryExecutionListener`, to avoid events from other tests breaking this test
with unexpected `executionCount` increments.
### Why are the changes needed?
Without draining the listener bus first, pending events from previous tests
could fire after the listener is registered, causing flaky test failures. Other
test suites follow this same pattern.
### Does this PR introduce _any_ user-facing change?
No. Test-only change.
### How was this patch tested?
Existing test.
### Was this patch authored or co-authored using generative AI tooling?
Yes.
Made with [Cursor](https://cursor.com)
Closes #54397 from cloud-fan/SPARK-54835-followup.
Authored-by: Wenchen Fan <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
---
.../org/apache/spark/sql/connector/DataSourceV2DataFrameSuite.scala | 2 ++
1 file changed, 2 insertions(+)
diff --git
a/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2DataFrameSuite.scala
b/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2DataFrameSuite.scala
index 5f093e965b32..eadaafea81a5 100644
---
a/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2DataFrameSuite.scala
+++
b/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2DataFrameSuite.scala
@@ -2155,6 +2155,8 @@ class DataSourceV2DataFrameSuite
}
try {
+ // drain listener bus before registering the listener.
+ sparkContext.listenerBus.waitUntilEmpty()
spark.listenerManager.register(listener)
val t = "testcat.ns1.ns2.tbl"
withTable(t) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]