Skip to content

Commit bf3f13b

Browse files
committed
rollback some forgotten changes
1 parent 89f9bc0 commit bf3f13b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,21 +211,21 @@ class TaskSetManagerSuite extends FunSuite with LocalSparkContext with Logging {
211211
val manager = new TaskSetManager(sched, taskSet, MAX_TASK_FAILURES, clock)
212212

213213
// An executor that is not NODE_LOCAL should be rejected.
214-
assert(manager.resourceOffer("execC", "host2", NODE_LOCAL) === None)
214+
assert(manager.resourceOffer("execC", "host2", ANY) === None)
215215

216216
// Because there are no alive PROCESS_LOCAL executors, the base locality level should be
217217
// NODE_LOCAL. So, we should schedule the task on this offered NODE_LOCAL executor before
218218
// any of the locality wait timers expire.
219-
assert(manager.resourceOffer("execA", "host1", NODE_LOCAL).get.index === 0)
219+
assert(manager.resourceOffer("execA", "host1", ANY).get.index === 0)
220220
}
221221

222222
test("basic delay scheduling") {
223223
sc = new SparkContext("local", "test")
224-
val sched = new FakeTaskScheduler(sc, ("exec1", "host1"), ("exec3", "host2"))
224+
val sched = new FakeTaskScheduler(sc, ("exec1", "host1"), ("exec2", "host2"))
225225
val taskSet = FakeTask.createTaskSet(4,
226226
Seq(TaskLocation("host1", "exec1")),
227227
Seq(TaskLocation("host2", "exec2")),
228-
Seq(TaskLocation("host1"), TaskLocation("host2", "exec3")),
228+
Seq(TaskLocation("host1"), TaskLocation("host2", "exec2")),
229229
Seq() // Last task has no locality prefs
230230
)
231231
val clock = new FakeClock
@@ -235,18 +235,18 @@ class TaskSetManagerSuite extends FunSuite with LocalSparkContext with Logging {
235235
assert(manager.resourceOffer("exec1", "host1", PROCESS_LOCAL) == None)
236236

237237
clock.advance(LOCALITY_WAIT)
238-
// Offer host1, exec1 again, at PROCESS_LOCAL level: the node local (task 2) should
238+
// Offer host1, exec1 again, at NODE_LOCAL level: the node local (task 2) should
239239
// get chosen before the noPref task
240240
assert(manager.resourceOffer("exec1", "host1", NODE_LOCAL).get.index == 2)
241241

242242
// Offer host2, exec3 again, at NODE_LOCAL level: we should choose task 2
243-
assert(manager.resourceOffer("exec3", "host2", NODE_LOCAL).get.index == 1)
243+
assert(manager.resourceOffer("exec2", "host2", NODE_LOCAL).get.index == 1)
244244

245245
// Offer host2, exec3 again, at NODE_LOCAL level: we should get noPref task
246246
// after failing to find a node_Local task
247-
assert(manager.resourceOffer("exec3", "host2", NODE_LOCAL) == None)
247+
assert(manager.resourceOffer("exec2", "host2", NODE_LOCAL) == None)
248248
clock.advance(LOCALITY_WAIT)
249-
assert(manager.resourceOffer("exec3", "host2", NO_PREF).get.index == 3)
249+
assert(manager.resourceOffer("exec2", "host2", NO_PREF).get.index == 3)
250250
}
251251

252252
test("we do not need to delay scheduling when we only have noPref tasks in the queue") {

0 commit comments

Comments
 (0)