mridulm commented on code in PR #41173:
URL: https://github.com/apache/spark/pull/41173#discussion_r1205402312
##########
resource-managers/yarn/src/test/scala/org/apache/spark/deploy/yarn/YarnAllocatorSuite.scala:
##########
@@ -832,4 +834,28 @@ class YarnAllocatorSuite extends SparkFunSuite with
Matchers {
verify(rpcEndPoint, times(1)).
send(DecommissionExecutorsOnHost(org.mockito.ArgumentMatchers.any()))
}
+
+ test("SPARK-43510: Running executors should be none when YarnAllocator adds
running executors " +
+ "after processing completed containers") {
+ val (handler, _) = createAllocator(1)
+ handler.updateResourceRequests()
+ handler.getNumExecutorsRunning should be(0)
+ handler.getNumContainersPendingAllocate should be(1)
+
+ val container = createContainer("host1")
+ handler.handleAllocatedContainers(Array(container))
+ handler.getNumExecutorsRunning should be(1)
+ handler.getNumContainersPendingAllocate should be(0)
+
+ val status = ContainerStatus.newInstance(
+ container.getId, ContainerState.COMPLETE, "Finished", 0)
+ val getOrUpdateNumExecutorsStartingForRPId = PrivateMethod[AtomicInteger](
+ Symbol("getOrUpdateNumExecutorsStartingForRPId"))
+
handler.invokePrivate(getOrUpdateNumExecutorsStartingForRPId(0)).incrementAndGet()
+ handler.processCompletedContainers(Seq(status))
+ val updateInternalState =
PrivateMethod[Unit](Symbol("updateInternalState"))
+ handler.invokePrivate(updateInternalState(0, "1", container))
+ handler.getNumExecutorsRunning should be(0)
+ handler.getNumExecutorsStarting should be(0)
Review Comment:
This test passes even without any of the changes proposed in this PR - is it
actually testing the changed behavior ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]