@@ -849,8 +849,8 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi
849849
850850 private val shuffleFileLossTests = Seq (
851851 (" executor process lost with shuffle service" , ExecutorProcessLost (" " , None ), true , false ),
852- (" worker lost with shuffle service" , ExecutorProcessLost (" " , None ), true , true ),
853- (" worker lost without shuffle service" , ExecutorProcessLost (" " , None ), false , true ),
852+ (" worker lost with shuffle service" , ExecutorProcessLost (" " , Some ( " hostA " ) ), true , true ),
853+ (" worker lost without shuffle service" , ExecutorProcessLost (" " , Some ( " hostA " ) ), false , true ),
854854 (" executor failure with shuffle service" , ExecutorKilled , true , false ),
855855 (" executor failure without shuffle service" , ExecutorKilled , false , true ))
856856
@@ -874,10 +874,18 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi
874874 val reduceRdd = new MyRDD (sc, 1 , List (shuffleDep), tracker = mapOutputTracker)
875875 submit(reduceRdd, Array (0 ))
876876 completeShuffleMapStageSuccessfully(0 , 0 , 1 )
877+ val expectHostFileLoss = event match {
878+ case ExecutorProcessLost (_, hostOpt, _) => hostOpt.isDefined
879+ case _ => false
880+ }
877881 runEvent(ExecutorLost (" hostA-exec" , event))
878882 verify(blockManagerMaster, times(1 )).removeExecutor(" hostA-exec" )
879883 if (expectFileLoss) {
880- verify(mapOutputTracker, times(1 )).removeOutputsOnExecutor(" hostA-exec" )
884+ if (expectHostFileLoss) {
885+ verify(mapOutputTracker, times(1 )).removeOutputsOnHost(" hostA" )
886+ } else {
887+ verify(mapOutputTracker, times(1 )).removeOutputsOnExecutor(" hostA-exec" )
888+ }
881889 intercept[MetadataFetchFailedException ] {
882890 mapOutputTracker.getMapSizesByExecutorId(shuffleId, 0 )
883891 }
0 commit comments