[SPARK-20483][MINOR] Test for Mesos Coarse mode may starve other Mesos frameworks
## What changes were proposed in this pull request? Add test case for scenarios where executor.cores is set as a (non)divisor of spark.cores.max This tests the change in #17786 ## How was this patch tested? Ran the existing test suite with the new tests dbtsai Author: Davis Shepherd <dshepherd@netflix.com> Closes #17788 from dgshep/add_mesos_test.
This commit is contained in:
parent
a4aa4665a6
commit
039e32ca19
|
@ -199,6 +199,40 @@ class MesosCoarseGrainedSchedulerBackendSuite extends SparkFunSuite
|
|||
verifyDeclinedOffer(driver, createOfferId("o2"), true)
|
||||
}
|
||||
|
||||
test("mesos declines offers with a filter when maxCores not a multiple of executor.cores") {
|
||||
val maxCores = 4
|
||||
val executorCores = 3
|
||||
setBackend(Map(
|
||||
"spark.cores.max" -> maxCores.toString,
|
||||
"spark.executor.cores" -> executorCores.toString
|
||||
))
|
||||
val executorMemory = backend.executorMemory(sc)
|
||||
offerResources(List(
|
||||
Resources(executorMemory, maxCores + 1),
|
||||
Resources(executorMemory, maxCores + 1)
|
||||
))
|
||||
verifyTaskLaunched(driver, "o1")
|
||||
verifyDeclinedOffer(driver, createOfferId("o2"), true)
|
||||
}
|
||||
|
||||
test("mesos declines offers with a filter when reached spark.cores.max with executor.cores") {
|
||||
val maxCores = 4
|
||||
val executorCores = 2
|
||||
setBackend(Map(
|
||||
"spark.cores.max" -> maxCores.toString,
|
||||
"spark.executor.cores" -> executorCores.toString
|
||||
))
|
||||
val executorMemory = backend.executorMemory(sc)
|
||||
offerResources(List(
|
||||
Resources(executorMemory, maxCores + 1),
|
||||
Resources(executorMemory, maxCores + 1),
|
||||
Resources(executorMemory, maxCores + 1)
|
||||
))
|
||||
verifyTaskLaunched(driver, "o1")
|
||||
verifyTaskLaunched(driver, "o2")
|
||||
verifyDeclinedOffer(driver, createOfferId("o3"), true)
|
||||
}
|
||||
|
||||
test("mesos assigns tasks round-robin on offers") {
|
||||
val executorCores = 4
|
||||
val maxCores = executorCores * 2
|
||||
|
|
Loading…
Reference in a new issue