Github user squito commented on a diff in the pull request:
https://github.com/apache/spark/pull/15237#discussion_r94500060
--- Diff: core/src/test/scala/org/apache/spark/scheduler/PoolSuite.scala ---
@@ -178,4 +176,39 @@ class PoolSuite extends SparkFunSuite with
LocalSparkContext {
scheduleTaskAndVerifyId(2, rootPool, 6)
scheduleTaskAndVerifyId(3, rootPool, 2)
}
+
+ test("SPARK-17663: 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)
+ verifyPool(rootPool, "pool_with_min_share_surrounded_whitespace", 3,
2, FAIR)
+ verifyPool(rootPool, "pool_with_weight_surrounded_whitespace", 1, 2,
FAIR)
+ verifyPool(rootPool,
"pool_with_scheduling_mode_surrounded_whitespace", 3, 2, FAIR)
--- End diff --
nit: can you just combine all these "surrounded_whitespace" cases into one
for all the properties?
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]