@@ -555,19 +555,15 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi
555
555
submit(reduceRdd, Array (0 , 1 , 2 ))
556
556
// Map stage completes successfully,
557
557
// two tasks are run on an executor on hostA and one on an executor on hostB
558
- complete(taskSets(0 ), Seq (
559
- (Success , makeMapStatus(" hostA" , 3 )),
560
- (Success , makeMapStatus(" hostA" , 3 )),
561
- (Success , makeMapStatus(" hostB" , 3 ))))
558
+ completeShuffleMapStageSuccessfully(0 , 0 , 3 , Seq (" hostA" , " hostA" , " hostB" ))
562
559
// Now the executor on hostA is lost
563
560
runEvent(ExecutorLost (" hostA-exec" , ExecutorExited (- 100 , false , " Container marked as failed" )))
564
561
565
562
// The MapOutputTracker has all the shuffle files
566
563
val initialMapStatuses = mapOutputTracker.shuffleStatuses(shuffleId).mapStatuses
567
- assert(initialMapStatuses.count(_ != null ) == 3 )
568
- assert(initialMapStatuses(0 ).location.executorId === " hostA-exec" )
569
- assert(initialMapStatuses(1 ).location.executorId === " hostA-exec" )
570
- assert(initialMapStatuses(2 ).location.executorId === " hostB-exec" )
564
+ assert(initialMapStatuses.count(_ != null ) === 3 )
565
+ assert(initialMapStatuses.count(s => s != null && s.location.executorId == " hostA-exec" ) === 2 )
566
+ assert(initialMapStatuses.count(s => s != null && s.location.executorId == " hostB-exec" ) === 1 )
571
567
572
568
// Now a fetch failure from the lost executor occurs
573
569
complete(taskSets(1 ), Seq (
@@ -576,8 +572,9 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi
576
572
577
573
// Shuffle files for hostA-exec should be lost
578
574
val mapStatuses = mapOutputTracker.shuffleStatuses(shuffleId).mapStatuses
579
- assert(mapStatuses.count(_ != null ) == 1 )
580
- assert(mapStatuses(2 ).location.executorId === " hostB-exec" )
575
+ assert(mapStatuses.count(_ != null ) === 1 )
576
+ assert(initialMapStatuses.count(s => s != null && s.location.executorId == " hostA-exec" ) === 0 )
577
+ assert(initialMapStatuses.count(s => s != null && s.location.executorId == " hostB-exec" ) === 1 )
581
578
}
582
579
583
580
test(" zero split job" ) {
0 commit comments