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

    https://github.com/apache/spark/pull/8887#discussion_r42199201
  
    --- Diff: 
core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala ---
    @@ -776,6 +776,30 @@ class TaskSetManagerSuite extends SparkFunSuite with 
LocalSparkContext with Logg
         assert(manager.myLocalityLevels.sameElements(Array(ANY)))
       }
     
    +  test("disabling executors does not reassign tasks") {
    +    sc = new SparkContext("local", "test")
    +    val sched = new FakeTaskScheduler(sc, ("exec1", "host1"))
    +    val taskSet = FakeTask.createTaskSet(1)
    +    val clock = new ManualClock
    +    val manager = new TaskSetManager(sched, taskSet, MAX_TASK_FAILURES, 
clock)
    +
    +    // Ensure task is assigned to the existing executor
    +    assert(manager.resourceOffer("exec1", "host1", ANY).get.index === 0)
    +
    +    // Add a new executor
    +    sched.addExecutor("exec2", "host2")
    +    manager.executorAdded()
    +
    +    // Disable the first executor, make sure task still won't be 
reassigned.
    +    manager.executorLost("exec1", "host1", LossReasonPending)
    +    assert(manager.resourceOffer("exec2", "host2", ANY) === None)
    +
    +    // Now remove the first executor, and make sure the task is reassigned.
    +    sched.removeExecutor("exec1")
    +    manager.executorLost("exec1", "host1", SlaveLost())
    --- End diff --
    
    can we add a test that assures `executorLost` gets called twice, once with 
pending and another time with the real reason?


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