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

    https://github.com/apache/spark/pull/17113#discussion_r106249028
  
    --- Diff: 
core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala ---
    @@ -1039,6 +1039,40 @@ class TaskSetManagerSuite extends SparkFunSuite with 
LocalSparkContext with Logg
           .updateBlacklistForFailedTask(anyString(), anyString(), anyInt())
       }
     
    +  test("update application blacklist for shuffle-fetch") {
    +    // Setup a taskset, and fail some tasks for a fetch failure, 
preemption, denied commit,
    +    // and killed task.
    +    val conf = new SparkConf()
    +      .set(config.BLACKLIST_ENABLED, true)
    +      .set(config.SHUFFLE_SERVICE_ENABLED, true)
    +      .set(config.BLACKLIST_FETCH_FAILURE_ENABLED, true)
    +    sc = new SparkContext("local", "test", conf)
    +    sched = new FakeTaskScheduler(sc, ("exec1", "host1"), ("exec2", 
"host2"))
    +    val taskSet = FakeTask.createTaskSet(4)
    +    val blacklistTracker = new BlacklistTracker(sc, None)
    +    val tsm = new TaskSetManager(sched, taskSet, 4, Some(blacklistTracker))
    +
    +    // make some offers to our taskset, to get tasks we will fail
    +    val taskDescs = Seq(
    +      "exec1" -> "host1",
    +      "exec2" -> "host2"
    +    ).flatMap { case (exec, host) =>
    +      // offer each executor twice (simulating 2 cores per executor)
    +      (0 until 2).flatMap{ _ => tsm.resourceOffer(exec, host, 
TaskLocality.ANY)}
    +    }
    +    assert(taskDescs.size === 4)
    +
    +    
assert(!blacklistTracker.isExecutorBlacklisted(taskDescs(0).executorId))
    +    assert(!blacklistTracker.isNodeBlacklisted("host1"))
    +
    +    // Fail the task with fetch failure
    +    tsm.handleFailedTask(taskDescs(0).taskId, TaskState.FAILED,
    +      FetchFailed(BlockManagerId(taskDescs(0).executorId, "host1", 12345), 
0, 0, 0, "ignored"))
    +
    +    assert(blacklistTracker.isExecutorBlacklisted(taskDescs(0).executorId))
    +    assert(blacklistTracker.isNodeBlacklisted("host1"))
    +  }
    --- End diff --
    
    I think you should also have a test with kill enabled, to see that all the 
executors on the host get killed.


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