@@ -77,7 +77,11 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B
7777 }
7878
7979 def setupScheduler (confs : (String , String )* ): TaskSchedulerImpl = {
80- val conf = new SparkConf ().setMaster(" local" ).setAppName(" TaskSchedulerImplSuite" )
80+ setupSchedulerWithMaster(" local" , confs : _* )
81+ }
82+
83+ def setupSchedulerWithMaster (master : String , confs : (String , String )* ): TaskSchedulerImpl = {
84+ val conf = new SparkConf ().setMaster(master).setAppName(" TaskSchedulerImplSuite" )
8185 confs.foreach { case (k, v) => conf.set(k, v) }
8286 sc = new SparkContext (conf)
8387 taskScheduler = new TaskSchedulerImpl (sc)
@@ -1129,7 +1133,7 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B
11291133 // you'd need the previous stage to also get restarted, and then succeed, in between each
11301134 // attempt, but that happens outside what we're mocking here.)
11311135 val zombieAttempts = (0 until 2 ).map { stageAttempt =>
1132- val attempt = FakeTask .createTaskSet(10 , stageAttemptId = stageAttempt)
1136+ val attempt = FakeTask .createTaskSet(10 , stageId = 0 , stageAttemptId = stageAttempt)
11331137 taskScheduler.submitTasks(attempt)
11341138 val tsm = taskScheduler.taskSetManagerForAttempt(0 , stageAttempt).get
11351139 val offers = (0 until 10 ).map{ idx => WorkerOffer (s " exec- $idx" , s " host- $idx" , 1 ) }
@@ -1148,7 +1152,7 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B
11481152 // we've now got 2 zombie attempts, each with 9 tasks still active. Submit the 3rd attempt for
11491153 // the stage, but this time with insufficient resources so not all tasks are active.
11501154
1151- val finalAttempt = FakeTask .createTaskSet(10 , stageAttemptId = 2 )
1155+ val finalAttempt = FakeTask .createTaskSet(10 , stageId = 0 , stageAttemptId = 2 )
11521156 taskScheduler.submitTasks(finalAttempt)
11531157 val finalTsm = taskScheduler.taskSetManagerForAttempt(0 , 2 ).get
11541158 val offers = (0 until 5 ).map{ idx => WorkerOffer (s " exec- $idx" , s " host- $idx" , 1 ) }
0 commit comments