Github user squito commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10951#discussion_r55765032
  
    --- Diff: 
core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala ---
    @@ -982,6 +988,52 @@ class DAGSchedulerSuite extends SparkFunSuite with 
LocalSparkContext with Timeou
         assert(countSubmittedMapStageAttempts() === 2)
       }
     
    +  test("task events always posted in speculation / when stage is killed") {
    +    val baseRdd = new MyRDD(sc, 4, Nil)
    +    val finalRdd = new MyRDD(sc, 4, List(new OneToOneDependency(baseRdd)))
    +    submit(finalRdd, Array(0, 1, 2, 3))
    +
    +    // complete two tasks
    +    runEvent(makeCompletionEvent(
    +      taskSets(0).tasks(0), Success, 42,
    +      Seq.empty[AccumulableInfo], createFakeTaskInfoWithId(0)))
    +    runEvent(makeCompletionEvent(
    +      taskSets(0).tasks(1), Success, 42,
    +      Seq.empty[AccumulableInfo], createFakeTaskInfoWithId(1)))
    +    sc.listenerBus.waitUntilEmpty(WAIT_TIMEOUT_MILLIS)
    +    // verify stage exists
    +    assert(scheduler.stageIdToStage.contains(0))
    +    assert(sparkListener.endedTasks.size == 2)
    +
    +    // finish other 2 tasks
    +    runEvent(makeCompletionEvent(
    +      taskSets(0).tasks(2), Success, 42,
    +      Seq.empty[AccumulableInfo], createFakeTaskInfoWithId(2)))
    +    runEvent(makeCompletionEvent(
    +      taskSets(0).tasks(3), Success, 42,
    +      Seq.empty[AccumulableInfo], createFakeTaskInfoWithId(3)))
    +    sc.listenerBus.waitUntilEmpty(WAIT_TIMEOUT_MILLIS)
    +    assert(sparkListener.endedTasks.size == 4)
    +
    +    // verify the stage is done
    +    assert(!scheduler.stageIdToStage.contains(0))
    +
    +    // stage should be complete finish one other Successful task to 
simulate what can happen
    --- End diff --
    
    super nit "stage should be complete. ..." (or whatever other punctuation 
you prefer)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to