spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andrewor14 <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-10618] [Mesos] Refactoring scheduling c...
Date Mon, 01 Feb 2016 23:28:54 GMT
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10326#discussion_r51499069
  
    --- Diff: core/src/test/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackendSuite.scala
---
    @@ -184,4 +193,47 @@ class CoarseMesosSchedulerBackendSuite extends SparkFunSuite
     
         verify(driver, times(1)).reviveOffers()
       }
    +
    +  test("isOfferSatisfiesRequirements return true when there is a valid offer") {
    +    val schedulerBackend = createSchedulerBackendForGivenSparkConf(sc)
    +
    +    assert(schedulerBackend.isOfferSatisfiesRequirements("Slave1", 10000, 5, sc))
    +  }
    +
    +
    +  test("isOfferSatisfiesRequirements return false when memory in offer is less" +
    +    " than required memory") {
    +    val schedulerBackend = createSchedulerBackendForGivenSparkConf(sc)
    +
    +    assert(schedulerBackend.isOfferSatisfiesRequirements("Slave1", 1, 5, sc) === false)
    +  }
    +
    +  test("isOfferSatisfiesRequirements return false when cpu in offer is less than required
cpu") {
    +    val schedulerBackend = createSchedulerBackendForGivenSparkConf(sc)
    +
    +    assert(schedulerBackend.isOfferSatisfiesRequirements("Slave1", 10000, 0, sc) ===
false)
    +  }
    +
    +  test("isOfferSatisfiesRequirements return false when offer is from slave already running"
+
    +    " an executor") {
    +    val schedulerBackend = createSchedulerBackendForGivenSparkConf(sc)
    +    schedulerBackend.slaveIdsWithExecutors += "Slave2"
    +
    +    assert(schedulerBackend.isOfferSatisfiesRequirements("Slave2", 10000, 5, sc) ===
false)
    +  }
    +
    +  test("isOfferSatisfiesRequirements return false when task is failed more than " +
    +    "MAX_SLAVE_FAILURES times on the given slave") {
    +    val schedulerBackend = createSchedulerBackendForGivenSparkConf(sc)
    +    schedulerBackend.failuresBySlaveId("Slave3") = 2
    +
    +    assert(schedulerBackend.isOfferSatisfiesRequirements("Slave3", 10000, 5, sc) ===
false)
    +  }
    +
    +  test("isOfferSatisfiesRequirements return false when max core is already acquired")
{
    +    val schedulerBackend = createSchedulerBackendForGivenSparkConf(sc)
    +    schedulerBackend.totalCoresAcquired = 10
    +
    +    assert(schedulerBackend.isOfferSatisfiesRequirements("Slave1", 10000, 5, sc) ===
false)
    --- End diff --
    
    instead of `assert(x === false)`, just do `assert(!x)`


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message