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

    https://github.com/apache/spark/pull/1313#discussion_r15851858
  
    --- Diff: 
core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala ---
    @@ -192,56 +211,59 @@ class TaskSetManagerSuite extends FunSuite with 
LocalSparkContext with Logging {
         val manager = new TaskSetManager(sched, taskSet, MAX_TASK_FAILURES, 
clock)
     
         // An executor that is not NODE_LOCAL should be rejected.
    -    assert(manager.resourceOffer("execC", "host2", ANY) === None)
    +    assert(manager.resourceOffer("execC", "host2", NODE_LOCAL) === None)
     
         // Because there are no alive PROCESS_LOCAL executors, the base 
locality level should be
         // NODE_LOCAL. So, we should schedule the task on this offered 
NODE_LOCAL executor before
         // any of the locality wait timers expire.
    -    assert(manager.resourceOffer("execA", "host1", ANY).get.index === 0)
    +    assert(manager.resourceOffer("execA", "host1", NODE_LOCAL).get.index 
=== 0)
       }
     
       test("basic delay scheduling") {
         sc = new SparkContext("local", "test")
    -    val sched = new FakeTaskScheduler(sc, ("exec1", "host1"), ("exec2", 
"host2"))
    +    val sched = new FakeTaskScheduler(sc, ("exec1", "host1"), ("exec3", 
"host2"))
         val taskSet = FakeTask.createTaskSet(4,
           Seq(TaskLocation("host1", "exec1")),
           Seq(TaskLocation("host2", "exec2")),
    -      Seq(TaskLocation("host1"), TaskLocation("host2", "exec2")),
    +      Seq(TaskLocation("host1"), TaskLocation("host2", "exec3")),
           Seq()   // Last task has no locality prefs
         )
         val clock = new FakeClock
         val manager = new TaskSetManager(sched, taskSet, MAX_TASK_FAILURES, 
clock)
    -
         // First offer host1, exec1: first task should be chosen
         assert(manager.resourceOffer("exec1", "host1", ANY).get.index === 0)
    -
    -    // Offer host1, exec1 again: the last task, which has no prefs, should 
be chosen
    -    assert(manager.resourceOffer("exec1", "host1", ANY).get.index === 3)
    -
    -    // Offer host1, exec1 again, at PROCESS_LOCAL level: nothing should 
get chosen
    -    assert(manager.resourceOffer("exec1", "host1", PROCESS_LOCAL) === None)
    +    assert(manager.resourceOffer("exec1", "host1", PROCESS_LOCAL) == None)
     
         clock.advance(LOCALITY_WAIT)
    -
    -    // Offer host1, exec1 again, at PROCESS_LOCAL level: nothing should 
get chosen
    -    assert(manager.resourceOffer("exec1", "host1", PROCESS_LOCAL) === None)
    -
    -    // Offer host1, exec1 again, at NODE_LOCAL level: we should choose 
task 2
    +    // Offer host1, exec1 again, at PROCESS_LOCAL level: the node local 
(task 2) should
    --- End diff --
    
    Comment is wrong, should say NODE_LOCAL


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