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

    https://github.com/apache/spark/pull/21033#discussion_r181199842
  
    --- Diff: 
resource-managers/mesos/src/test/scala/org/apache/spark/scheduler/cluster/mesos/MesosCoarseGrainedSchedulerBackendSuite.scala
 ---
    @@ -165,18 +165,47 @@ class MesosCoarseGrainedSchedulerBackendSuite extends 
SparkFunSuite
       }
     
     
    -  test("mesos does not acquire more than spark.mesos.gpus.max") {
    -    val maxGpus = 5
    -    setBackend(Map("spark.mesos.gpus.max" -> maxGpus.toString))
    +  test("mesos acquires spark.mesos.executor.gpus number of gpus per 
executor") {
    +    setBackend(Map("spark.mesos.gpus.max" -> "5",
    +                   "spark.mesos.executor.gpus" -> "2"))
     
         val executorMemory = backend.executorMemory(sc)
    -    offerResources(List(Resources(executorMemory, 1, maxGpus + 1)))
    +    offerResources(List(Resources(executorMemory, 1, 5)))
     
         val taskInfos = verifyTaskLaunched(driver, "o1")
         assert(taskInfos.length == 1)
     
         val gpus = backend.getResource(taskInfos.head.getResourcesList, "gpus")
    -    assert(gpus == maxGpus)
    +    assert(gpus == 2)
    +  }
    +
    +
    +  test("mesos declines offers that cannot satisfy 
spark.mesos.executor.gpus") {
    +    setBackend(Map("spark.mesos.gpus.max" -> "5",
    --- End diff --
    
    I think it's worth testing setting max less than the number of executor 
gpus as well.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to