Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/20888#discussion_r181456125
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/DataFrameRangeSuite.scala ---
@@ -152,22 +154,28 @@ class DataFrameRangeSuite extends QueryTest with
SharedSQLContext with Eventuall
}
test("Cancelling stage in a query with Range.") {
+ val slices = 10
+
val listener = new SparkListener {
- override def onJobStart(jobStart: SparkListenerJobStart): Unit = {
- eventually(timeout(10.seconds), interval(1.millis)) {
- assert(DataFrameRangeSuite.stageToKill > 0)
+ override def onTaskStart(taskStart: SparkListenerTaskStart): Unit = {
+ eventually(timeout(10.seconds)) {
+ assert(DataFrameRangeSuite.isTaskStarted)
}
- sparkContext.cancelStage(DataFrameRangeSuite.stageToKill)
+ sparkContext.cancelStage(taskStart.stageId)
+ DataFrameRangeSuite.semaphore.release(slices)
--- End diff --
The task can wait on itself (`synchronized { wait() }`). The goal is to
just go to sleep indefinitely.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]