Skip to content
Snippets Groups Projects
Unverified Commit 039e32ca authored by Davis Shepherd's avatar Davis Shepherd Committed by DB Tsai
Browse files

[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.
parent a4aa4665
No related branches found
No related tags found
No related merge requests found
...@@ -199,6 +199,40 @@ class MesosCoarseGrainedSchedulerBackendSuite extends SparkFunSuite ...@@ -199,6 +199,40 @@ class MesosCoarseGrainedSchedulerBackendSuite extends SparkFunSuite
verifyDeclinedOffer(driver, createOfferId("o2"), true) 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") { test("mesos assigns tasks round-robin on offers") {
val executorCores = 4 val executorCores = 4
val maxCores = executorCores * 2 val maxCores = executorCores * 2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment