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

    https://github.com/apache/spark/pull/15237#discussion_r90543989
  
    --- Diff: core/src/test/scala/org/apache/spark/scheduler/PoolSuite.scala ---
    @@ -74,30 +79,24 @@ class PoolSuite extends SparkFunSuite with 
LocalSparkContext {
        */
       test("Fair Scheduler Test") {
         val xmlPath = 
getClass.getClassLoader.getResource("fairscheduler.xml").getFile()
    -    val conf = new SparkConf().set("spark.scheduler.allocation.file", 
xmlPath)
    -    sc = new SparkContext("local", "TaskSchedulerImplSuite", conf)
    +    val conf = new SparkConf().set(SCHEDULER_ALLOCATION_FILE_PROPERTY, 
xmlPath)
    +    sc = new SparkContext(LOCAL, APP_NAME, conf)
         val taskScheduler = new TaskSchedulerImpl(sc)
     
    -    val rootPool = new Pool("", SchedulingMode.FAIR, 0, 0)
    +    val rootPool = new Pool("", FAIR, 0, 0)
         val schedulableBuilder = new FairSchedulableBuilder(rootPool, sc.conf)
         schedulableBuilder.buildPools()
     
         // Ensure that the XML file was read in correctly.
    -    assert(rootPool.getSchedulableByName("default") != null)
    -    assert(rootPool.getSchedulableByName("1") != null)
    -    assert(rootPool.getSchedulableByName("2") != null)
    -    assert(rootPool.getSchedulableByName("3") != null)
    -    assert(rootPool.getSchedulableByName("1").minShare === 2)
    -    assert(rootPool.getSchedulableByName("1").weight === 1)
    -    assert(rootPool.getSchedulableByName("2").minShare === 3)
    -    assert(rootPool.getSchedulableByName("2").weight === 1)
    -    assert(rootPool.getSchedulableByName("3").minShare === 0)
    -    assert(rootPool.getSchedulableByName("3").weight === 1)
    +    verifyPool(rootPool, schedulableBuilder.DEFAULT_POOL_NAME, 0, 1, FIFO)
    +    verifyPool(rootPool, "1", 2, 1, FIFO)
    +    verifyPool(rootPool, "2", 3, 1, FIFO)
    +    verifyPool(rootPool, "3", 0, 1, FIFO)
     
         val properties1 = new Properties()
    -    properties1.setProperty("spark.scheduler.pool", "1")
    +    properties1.setProperty(SCHEDULER_POOL_PROPERTY, "1")
    --- End diff --
    
    eg., here you'd do
    
    ```scala
    properties1.setProperty(schedulableBuilder.FAIR_SCHEDULER_PROPERTIES, "1")
    ```


---
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