This is an automated email from the ASF dual-hosted git repository.

voonhous pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git


The following commit(s) were added to refs/heads/master by this push:
     new 5a42f8957f09 test(spark): Fix flaky TestSparkFilterHelper by giving it 
its own SparkSession (#19356)
5a42f8957f09 is described below

commit 5a42f8957f0971593572663ba9dedb94398545e3
Author: Vova Kolmakov <[email protected]>
AuthorDate: Thu Jul 23 14:35:41 2026 +0700

    test(spark): Fix flaky TestSparkFilterHelper by giving it its own 
SparkSession (#19356)
    
    testConvertInExpression calls org.apache.spark.sql.functions.expr(...), 
which lazily builds a SessionState on the active SparkSession. 
TestSparkFilterHelper extended HoodieSparkClientTestHarness directly without 
wiring @BeforeEach initSparkContexts(), so it relied on a leaked active session 
from a prior test in the same Surefire fork and intermittently failed with 
"LiveListenerBus is stopped" when that session's context was already stopped. 
Add @BeforeEach/@AfterEach that create and s [...]
    
    Co-authored-by: Vova Kolmakov <[email protected]>
---
 .../test/scala/org/apache/hudi/TestSparkFilterHelper.scala   | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git 
a/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/TestSparkFilterHelper.scala
 
b/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/TestSparkFilterHelper.scala
index 2c41800eae14..c542a76b9c37 100644
--- 
a/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/TestSparkFilterHelper.scala
+++ 
b/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/TestSparkFilterHelper.scala
@@ -28,12 +28,22 @@ import org.apache.spark.sql.catalyst.expressions._
 import org.apache.spark.sql.functions._
 import org.apache.spark.sql.types._
 import org.apache.spark.unsafe.types.UTF8String
-import org.junit.jupiter.api.{Assertions, Test}
+import org.junit.jupiter.api.{AfterEach, Assertions, BeforeEach, Test}
 
 import scala.collection.JavaConverters._
 
 class TestSparkFilterHelper extends HoodieSparkClientTestHarness with 
SparkAdapterSupport  {
 
+  @BeforeEach
+  def setUp(): Unit = {
+    initSparkContexts()
+  }
+
+  @AfterEach
+  def tearDown(): Unit = {
+    cleanupSparkContexts()
+  }
+
   @Test
   def testConvertInExpression(): Unit = {
     val filterExpr = sparkAdapter.translateFilter(

Reply via email to