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

    https://github.com/apache/spark/pull/9796#discussion_r48070489
  
    --- Diff: 
core/src/test/scala/org/apache/spark/deploy/StandaloneDynamicAllocationSuite.scala
 ---
    @@ -386,23 +386,28 @@ class StandaloneDynamicAllocationSuite
         // the driver refuses to kill executors it does not know about
         syncExecutors(sc)
         val executors = getExecutorIds(sc)
    +    val executorIdsBefore = executors.toSet
         assert(executors.size === 2)
    -    // kill executor 1, and replace it
    +    // kill and replace an executor
         assert(sc.killAndReplaceExecutor(executors.head))
         eventually(timeout(10.seconds), interval(10.millis)) {
           val apps = getApplications()
           assert(apps.head.executors.size === 2)
    +      val executorIdsAfter = getExecutorIds(sc).toSet
    +      // make sure the executor was killed and replaced
    +      assert(executorIdsBefore != executorIdsAfter)
         }
     
    -    var apps = getApplications()
    -    // kill executor 1
    -    assert(sc.killExecutor(executors.head))
    -    apps = getApplications()
    -    assert(apps.head.executors.size === 2)
    -    assert(apps.head.getExecutorLimit === 2)
    -    // kill executor 2
    -    assert(sc.killExecutor(executors(1)))
    -    apps = getApplications()
    +    // kill old executor (which is killedAndReplaced) should fail
    +    assert(!sc.killExecutor(executors.head))
    +
    +    // refresh executors list
    +    val newExecutors = getExecutorIds(sc)
    +    syncExecutors(sc)
    +
    +    // kill newly created executor and do not replace it
    +    assert(sc.killExecutor(newExecutors(1)))
    --- End diff --
    
    why not just kill `newExecutors.head`? This is kind of arbitrary


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