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

    https://github.com/apache/spark/pull/15237#discussion_r90548835
  
    --- Diff: core/src/test/scala/org/apache/spark/scheduler/PoolSuite.scala ---
    @@ -178,4 +177,36 @@ class PoolSuite extends SparkFunSuite with 
LocalSparkContext {
         scheduleTaskAndVerifyId(2, rootPool, 6)
         scheduleTaskAndVerifyId(3, rootPool, 2)
       }
    +
    +  test("FairSchedulableBuilder sets default values for blank or invalid 
datas") {
    +    val xmlPath = 
getClass.getClassLoader.getResource("fairscheduler-with-invalid-data.xml")
    +      .getFile()
    +    val conf = new SparkConf().set(SCHEDULER_ALLOCATION_FILE_PROPERTY, 
xmlPath)
    +
    +    val rootPool = new Pool("", FAIR, 0, 0)
    +    val schedulableBuilder = new FairSchedulableBuilder(rootPool, conf)
    +    schedulableBuilder.buildPools()
    +
    +    verifyPool(rootPool, schedulableBuilder.DEFAULT_POOL_NAME, 0, 1, FIFO)
    +    verifyPool(rootPool, "pool_with_invalid_min_share", 0, 2, FAIR)
    +    verifyPool(rootPool, "pool_with_invalid_weight", 1, 1, FAIR)
    +    verifyPool(rootPool, "pool_with_invalid_scheduling_mode", 3, 2, FIFO)
    +    verifyPool(rootPool, "pool_with_non_uppercase_scheduling_mode", 2, 1, 
FAIR)
    +    verifyPool(rootPool, "pool_with_NONE_scheduling_mode", 1, 2, FIFO)
    +    verifyPool(rootPool, "pool_with_whitespace_min_share", 0, 2, FAIR)
    +    verifyPool(rootPool, "pool_with_whitespace_weight", 1, 1, FAIR)
    +    verifyPool(rootPool, "pool_with_whitespace_scheduling_mode", 3, 2, 
FIFO)
    +    verifyPool(rootPool, "pool_with_empty_min_share", 0, 3, FAIR)
    +    verifyPool(rootPool, "pool_with_empty_weight", 2, 1, FAIR)
    +    verifyPool(rootPool, "pool_with_empty_scheduling_mode", 2, 2, FIFO)
    --- End diff --
    
    with my suggestion on `trim`, you could also add a test case for a mode w/ 
surrounding whitespace.


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

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

Reply via email to