Github user squito commented on a diff in the pull request:
https://github.com/apache/spark/pull/16650#discussion_r98283147
--- Diff:
core/src/test/scala/org/apache/spark/scheduler/BlacklistTrackerSuite.scala ---
@@ -456,4 +459,61 @@ class BlacklistTrackerSuite extends SparkFunSuite with
BeforeAndAfterEach with M
conf.remove(config)
}
}
+
+ test("blacklisting kills executors, configured by
BLACKLIST_KILL_ENABLED") {
+ val allocationClientMock = mock[ExecutorAllocationClient]
+ when(allocationClientMock.killExecutors(any(), any(),
any())).thenReturn(Seq("called"))
+ when(allocationClientMock.killExecutorsOnHost(any())).thenReturn(true)
+ blacklist = new BlacklistTracker(listenerBusMock, conf,
Some(allocationClientMock), clock)
+
+ // Disable auto-kill. Blacklist an executor and make sure
killExecutors is not called.
+ conf.set(config.BLACKLIST_KILL_ENABLED, false)
+
+ val taskSetBlacklist0 = createTaskSetBlacklist(stageId = 0)
+ // Fail 4 tasks in one task set on executor 1, so that executor gets
blacklisted for the whole
+ // application.
+ (0 until 4).foreach { partition =>
+ taskSetBlacklist0.updateBlacklistForFailedTask("hostA", exec = "1",
index = partition)
+ }
+ blacklist.updateBlacklistForSuccessfulTaskSet(0, 0,
taskSetBlacklist0.execToFailures)
+
+ verify(allocationClientMock, times(0)).killExecutor(any())
--- End diff --
you could also use `Mockito.never` instead of `times(0)`
---
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]