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

    https://github.com/apache/spark/pull/16650#discussion_r99661191
  
    --- Diff: 
core/src/test/scala/org/apache/spark/deploy/StandaloneDynamicAllocationSuite.scala
 ---
    @@ -467,6 +469,51 @@ class StandaloneDynamicAllocationSuite
         }
       }
     
    +  test("kill all executors on localhost") {
    +    sc = new SparkContext(appConf)
    +    val appId = sc.applicationId
    +    eventually(timeout(10.seconds), interval(10.millis)) {
    +      val apps = getApplications()
    +      assert(apps.size === 1)
    +      assert(apps.head.id === appId)
    +      assert(apps.head.executors.size === 2)
    +      assert(apps.head.getExecutorLimit === Int.MaxValue)
    +    }
    +    val beforeList = getApplications().head.executors.keys.toSet
    +    // kill all executors without replacement
    +    assert(killExecutorsOnHost(sc, "localhost").equals(true))
    +
    +    syncExecutors(sc)
    +    val afterList = getApplications().head.executors.keys.toSet
    +
    +    eventually(timeout(10.seconds), interval(100.millis)) {
    +      assert(beforeList.intersect(afterList).size == 0)
    +    }
    +  }
    +
    +  test("executor registration on a blacklisted host must fail") {
    +    sc = new SparkContext(appConf.set(config.BLACKLIST_ENABLED.key, 
"true"))
    +    val endpointRef = mock(classOf[RpcEndpointRef])
    +    val mockAddress = mock(classOf[RpcAddress])
    +    when(endpointRef.address).thenReturn(mockAddress)
    +    val message = RegisterExecutor("one", endpointRef, "localhost", 10, 
Map.empty)
    +
    +    // Get "localhost" on a blacklist.
    +    val taskScheduler = mock(classOf[TaskSchedulerImpl])
    +    when(taskScheduler.nodeBlacklist()).thenReturn(Set("localhost"))
    --- End diff --
    
    Let's call it "blacklisted-host".


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

Reply via email to