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

dongjoon-hyun pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new 643b15f9b51c [SPARK-60430][4.0][CORE][TEST][FOLLOWUP] Use `foreach` 
instead of `gridTest` in `RecoverySuite`
643b15f9b51c is described below

commit 643b15f9b51cbcbe318440c865225654a94b0761
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Wed Oct 21 21:56:00 2026 -0700

    [SPARK-60430][4.0][CORE][TEST][FOLLOWUP] Use `foreach` instead of 
`gridTest` in `RecoverySuite`
    
    ### What changes were proposed in this pull request?
    
    This PR aims to fix the `core` test compilation in `branch-4.0` by 
replacing `gridTest` with `Seq.foreach` in `RecoverySuite`.
    
    The SPARK-60430 backport to `branch-4.0` (682e33b84d5, #59680) kept 
master's `gridTest` call.
    
    ```scala
    gridTest("SPARK-60430: Recovery with explicit none codec")(Seq("none", 
"NONE")) { codecName =>
    ```
    
    However, `SparkFunSuite.gridTest` was added by SPARK-52405 (#51098) in 
Apache Spark 4.1.0, so `branch-4.0` doesn't have it. This PR uses the 
`Seq.foreach` pattern of the other `branch-4.0` test suites like 
`WorkerSelectionSuite`. The test names are identical to the ones that 
`gridTest` generates.
    
    ```scala
    Seq("none", "NONE").foreach { codecName =>
      test(s"SPARK-60430: Recovery with explicit none codec ($codecName)") {
    ```
    
    ### Why are the changes needed?
    
    To fix the compilation failure of the `core` test code in `branch-4.0`. The 
test jobs fail at the `core` test compilation.
    
    ```
    [error] 
.../core/src/test/scala/org/apache/spark/deploy/master/RecoverySuite.scala:516:3:
 not found: value gridTest
    [error]   gridTest("SPARK-60430: Recovery with explicit none 
codec")(Seq("none", "NONE")) { codecName =>
    [error]   ^
    [error] one error found
    [error] (core / Test / compileIncremental) Compilation failed
    ```
    
    ### Does this PR introduce _any_ user-facing change?
    
    No, this is a test-only change.
    
    ### How was this patch tested?
    
    Pass the CIs. I also ran the following manually on `branch-4.0` with JDK 21.
    
    ```
    $ build/sbt 'core/testOnly org.apache.spark.deploy.master.RecoverySuite 
org.apache.spark.deploy.master.PersistenceEngineSuite'
    ...
    [info] - SPARK-60430: Recovery with explicit none codec (none) (16 
milliseconds)
    [info] - SPARK-60430: Recovery with explicit none codec (NONE) (17 
milliseconds)
    ...
    [info] Tests: succeeded 24, failed 0, canceled 0, ignored 0, pending 0
    [info] All tests passed.
    ```
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    Generated-by: Claude Opus 5.5
    
    Closes #59698 from dongjoon-hyun/SPARK-60430-4.0.
    
    Authored-by: Dongjoon Hyun <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 .../apache/spark/deploy/master/RecoverySuite.scala | 34 ++++++++++++----------
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git 
a/core/src/test/scala/org/apache/spark/deploy/master/RecoverySuite.scala 
b/core/src/test/scala/org/apache/spark/deploy/master/RecoverySuite.scala
index cbe20c58f7c9..e0630bbe578c 100644
--- a/core/src/test/scala/org/apache/spark/deploy/master/RecoverySuite.scala
+++ b/core/src/test/scala/org/apache/spark/deploy/master/RecoverySuite.scala
@@ -513,22 +513,24 @@ class RecoverySuite extends MasterSuiteBase {
     }
   }
 
-  gridTest("SPARK-60430: Recovery with explicit none codec")(Seq("none", 
"NONE")) { codecName =>
-    val conf = new SparkConf(loadDefaults = false)
-    conf.set(RECOVERY_MODE, "FILESYSTEM")
-    conf.set(RECOVERY_DIRECTORY, System.getProperty("java.io.tmpdir"))
-    conf.set(RECOVERY_COMPRESSION_CODEC, codecName)
-
-    var master: Master = null
-    try {
-      master = makeAliveMaster(conf)
-      val e = 
master.persistenceEngine.asInstanceOf[FileSystemPersistenceEngine]
-      assert(e.codec.isEmpty)
-    } finally {
-      if (master != null) {
-        master.rpcEnv.shutdown()
-        master.rpcEnv.awaitTermination()
-        master = null
+  Seq("none", "NONE").foreach { codecName =>
+    test(s"SPARK-60430: Recovery with explicit none codec ($codecName)") {
+      val conf = new SparkConf(loadDefaults = false)
+      conf.set(RECOVERY_MODE, "FILESYSTEM")
+      conf.set(RECOVERY_DIRECTORY, System.getProperty("java.io.tmpdir"))
+      conf.set(RECOVERY_COMPRESSION_CODEC, codecName)
+
+      var master: Master = null
+      try {
+        master = makeAliveMaster(conf)
+        val e = 
master.persistenceEngine.asInstanceOf[FileSystemPersistenceEngine]
+        assert(e.codec.isEmpty)
+      } finally {
+        if (master != null) {
+          master.rpcEnv.shutdown()
+          master.rpcEnv.awaitTermination()
+          master = null
+        }
       }
     }
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to