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

ulyssesyou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git


The following commit(s) were added to refs/heads/master by this push:
     new 0025505  [KYUUBI #2189] Manage test failures with kyuubi spark nightly 
build - deregister when meeting specified exception *** FAILED ***
0025505 is described below

commit 0025505ae98b6d8c9af175c5b45fb2c0db00e7a9
Author: Nick Song <[email protected]>
AuthorDate: Mon Mar 21 11:04:37 2022 +0800

    [KYUUBI #2189] Manage test failures with kyuubi spark nightly build - 
deregister when meeting specified exception *** FAILED ***
    
    ### _Why are the changes needed?_
    
    deregister when meeting specified exception *** FAILED ***
    The code passed to eventually never returned normally. Attempted 15 times 
over 5.008027662 seconds. Last failure message: STARTED did not equal STOPPED. 
(SparkSQLEngineDeregisterSuite.scala:50)
    #2189
    deregister exception ttl test *** FAILED ***
    The code passed to eventually never returned normally. Attempted 15 times 
over 5.007941715 seconds. Last failure message: STARTED did not equal STOPPED. 
(SparkSQLEngineDeregisterSuite.scala:98)
    #2188
    
    ### _How was this patch tested?_
    - [ ] Add some test cases that check the changes thoroughly including 
negative and positive cases if possible
    
    - [ ] Add screenshots for manual tests if appropriate
    
    - [x] [Run 
test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests)
 locally before make a pull request
    
    Closes #2192 from Nick-0723/fix_deregister_test.
    
    Closes #2189
    
    fcd5ff4d [Nick Song] minor version need greater then 2
    5981d96a [Nick Song] remove import
    59753d5c [Nick Song] move the import to the case clause
    6f29f743 [Nick Song] fix deregister exception test
    
    Authored-by: Nick Song <[email protected]>
    Signed-off-by: ulysses-you <[email protected]>
---
 .../spark/kyuubi/SparkSQLEngineDeregisterSuite.scala  | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git 
a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/spark/kyuubi/SparkSQLEngineDeregisterSuite.scala
 
b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/spark/kyuubi/SparkSQLEngineDeregisterSuite.scala
index 45c0a0a..8ab44e0 100644
--- 
a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/spark/kyuubi/SparkSQLEngineDeregisterSuite.scala
+++ 
b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/spark/kyuubi/SparkSQLEngineDeregisterSuite.scala
@@ -24,6 +24,7 @@ import org.apache.spark.sql.internal.SQLConf.ANSI_ENABLED
 import org.scalatest.time.SpanSugar.convertIntToGrainOfTime
 
 import org.apache.kyuubi.config.KyuubiConf._
+import org.apache.kyuubi.engine.spark.KyuubiSparkUtil.sparkMajorMinorVersion
 import org.apache.kyuubi.engine.spark.WithDiscoverySparkSQLEngine
 import org.apache.kyuubi.service.ServiceState
 
@@ -56,8 +57,14 @@ abstract class SparkSQLEngineDeregisterSuite extends 
WithDiscoverySparkSQLEngine
 
 class SparkSQLEngineDeregisterExceptionSuite extends 
SparkSQLEngineDeregisterSuite {
   override def withKyuubiConf: Map[String, String] = {
-    super.withKyuubiConf ++ Map(ENGINE_DEREGISTER_EXCEPTION_CLASSES.key ->
-      classOf[ArithmeticException].getCanonicalName)
+    super.withKyuubiConf ++ Map(ENGINE_DEREGISTER_EXCEPTION_CLASSES.key -> {
+      sparkMajorMinorVersion match {
+        // see https://issues.apache.org/jira/browse/SPARK-35958
+        case (3, minor) if minor > 2 => 
"org.apache.spark.SparkArithmeticException"
+        case _ => classOf[ArithmeticException].getCanonicalName
+      }
+    })
+
   }
 }
 
@@ -75,7 +82,13 @@ class SparkSQLEngineDeregisterExceptionTTLSuite extends 
WithDiscoverySparkSQLEng
   override def withKyuubiConf: Map[String, String] = {
     super.withKyuubiConf ++ Map(
       ANSI_ENABLED.key -> "true",
-      ENGINE_DEREGISTER_EXCEPTION_CLASSES.key -> 
classOf[ArithmeticException].getCanonicalName,
+      ENGINE_DEREGISTER_EXCEPTION_CLASSES.key -> {
+        sparkMajorMinorVersion match {
+          // see https://issues.apache.org/jira/browse/SPARK-35958
+          case (3, minor) if minor > 2 => 
"org.apache.spark.SparkArithmeticException"
+          case _ => classOf[ArithmeticException].getCanonicalName
+        }
+      },
       ENGINE_DEREGISTER_JOB_MAX_FAILURES.key -> maxJobFailures.toString,
       ENGINE_DEREGISTER_EXCEPTION_TTL.key -> deregisterExceptionTTL.toString)
   }

Reply via email to