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

    https://github.com/apache/spark/pull/5636#discussion_r29474028
  
    --- Diff: 
core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala ---
    @@ -475,7 +475,58 @@ class DAGSchedulerSuite
         assert(results === Map(0 -> 42, 1 -> 43))
         assertDataStructuresEmpty()
       }
    +  
    +  test("Test taskAbort after multiple stage failures.") {
    +    // Create a new Listener to confirm that the listenerBus sees the 
JobEnd message 
    +    // when we abort the stage. This message will also be consumed by the 
EventLoggingListener
    +    // so this will propagate up to the user. 
    +    var ended = false
    +    var jobResult : JobResult = null
    +    class EndListener extends SparkListener {
    +      override def onJobEnd(jobEnd: SparkListenerJobEnd): Unit = {
    +        jobResult = jobEnd.jobResult
    +        ended = true
    +      }
    +    }
     
    +    sc.listenerBus.addListener(new EndListener())
    +    
    +    val shuffleMapRdd = new MyRDD(sc, 2, Nil)
    +    val shuffleDep = new ShuffleDependency(shuffleMapRdd, null)
    +    val shuffleId = shuffleDep.shuffleId
    +    val reduceRdd = new MyRDD(sc, 2, List(shuffleDep))
    +    submit(reduceRdd, Array(0, 1))
    +    sparkListener.failedStages.clear()
    +    scheduler.resubmitFailedStages()
    +    
    +    complete(taskSets(0), Seq(
    +      (Success, makeMapStatus("hostA", 1)),
    +      (Success, makeMapStatus("hostB", 1))))
    +    
    +    // Create stage object to get maxStageFailures
    +    val stage = new ResultStage(0, reduceRdd, 0, null, 0, new 
CallSite("blah","blah"))
    +    for (x <- 1 to stage.maxStageFailures) {
    +      // the 2nd ResultTask failed
    +      complete(taskSets(1), Seq(
    +        (Success, 42),
    +        (FetchFailed(makeBlockManagerId("hostA"), shuffleId, 0, 0, 
"ignored"), null)))
    +
    +      scheduler.resubmitFailedStages()
    +      if (x < stage.maxStageFailures) {
    +        assert(scheduler.runningStages.nonEmpty)
    +        assert(!ended)
    +        assert(!jobResult.isInstanceOf[JobFailed])
    --- End diff --
    
    Imran - I wanted to specifically check that it's an instance of 
```JobFailed``` since that's the ```EventType``` that's  created in the 
```DAGScheduler``` when a stage is aborted. 


---
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