ulysses-you commented on a change in pull request #30481:
URL: https://github.com/apache/spark/pull/30481#discussion_r529336316



##########
File path: 
sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ThriftServerWithSparkContextSuite.scala
##########
@@ -79,6 +84,45 @@ trait ThriftServerWithSparkContextSuite extends 
SharedThriftServer {
         "java.lang.NumberFormatException: invalid input syntax for type 
numeric: 1.2"))
     }
   }
+
+  test("SPARK-33526: Add config to control if cancel invoke interrupt task on 
thriftserver") {
+    withJdbcStatement { statement =>
+      val forceCancel = new AtomicBoolean(false)
+      val listener = new SparkListener {
+        override def onTaskEnd(taskEnd: SparkListenerTaskEnd): Unit = {
+          taskEnd.reason match {
+            case _: TaskKilled =>
+              if (forceCancel.get()) {
+                assert(System.currentTimeMillis() - 
taskEnd.taskInfo.launchTime < 1000)
+              } else {
+                assert(System.currentTimeMillis() - 
taskEnd.taskInfo.launchTime >= 2900)

Review comment:
       avoid the sleep accuracy so check 2.9s instead of 3s.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to