Github user squito commented on a diff in the pull request: https://github.com/apache/spark/pull/20640#discussion_r169413261 --- Diff: resource-managers/mesos/src/test/scala/org/apache/spark/scheduler/cluster/mesos/MesosCoarseGrainedSchedulerBackendSuite.scala --- @@ -108,6 +108,28 @@ class MesosCoarseGrainedSchedulerBackendSuite extends SparkFunSuite verifyTaskLaunched(driver, "o2") } + test("mesos declines offers from blacklisted slave") { + setBackend() + + // launches a task on a valid offer on slave s0 + val minMem = backend.executorMemory(sc) + 1024 + val minCpu = 4 + val offer1 = Resources(minMem, minCpu) + offerResources(List(offer1)) + verifyTaskLaunched(driver, "o1") + + // for any reason executor(aka mesos task) failed on s0 + val status = createTaskStatus("0", "s1", TaskState.TASK_FAILED) + backend.statusUpdate(driver, status) + when(taskScheduler.nodeBlacklist()).thenReturn(Set("s1")) + + val offer2 = Resources(minMem, minCpu) + // Launches a new task on a valid offer from the same slave + offerResources(List(offer2)) + // but since it's blacklisted the offer is declined + verifyDeclinedOffer(driver, createOfferId("o1")) --- End diff -- ah nevermind. I took another look at the code and now I see how this works
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org