LuciferYang commented on code in PR #41005:
URL: https://github.com/apache/spark/pull/41005#discussion_r1200491392
##########
connector/connect/client/jvm/src/test/scala/org/apache/spark/sql/ClientE2ETestSuite.scala:
##########
@@ -867,6 +872,71 @@ class ClientE2ETestSuite extends RemoteSparkSession with
SQLHelper {
assert(!df.filter(df("_2").endsWith(suffix)).isEmpty)
}
}
+
+ test("interrupt all - background queries, foreground interrupt") {
+ val session = spark
+ import session.implicits._
+ implicit val ec = ExecutionContext.global
+ val q1 = Future {
+ spark.range(10).map(n => { Thread.sleep(30000); n }).collect()
+ }
+ val q2 = Future {
+ spark.range(10).map(n => { Thread.sleep(30000); n }).collect()
+ }
+ var q1Interrupted = false
+ var q2Interrupted = false
+ var error: Option[String] = None
+ q1.onComplete {
+ case Success(_) =>
+ error = Some("q1 shouldn't have finished!")
+ case Failure(t) if t.getMessage.contains("cancelled") =>
+ q1Interrupted = true
+ case Failure(t) =>
+ error = Some("unexpected failure in q1: " + t.toString)
+ }
+ q1.onComplete {
Review Comment:
`q1`? `q2`?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]