attilapiros commented on a change in pull request #24241: 
[SPARK-27323][CORE][SQL][STREAMING] Use Single-Abstract-Method support in Scala 
2.12 to simplify code
URL: https://github.com/apache/spark/pull/24241#discussion_r270986895
 
 

 ##########
 File path: 
core/src/test/scala/org/apache/spark/scheduler/BlacklistTrackerSuite.scala
 ##########
 @@ -552,17 +547,13 @@ class BlacklistTrackerSuite extends SparkFunSuite with 
BeforeAndAfterEach with M
   test("fetch failure blacklisting kills executors, configured by 
BLACKLIST_KILL_ENABLED") {
     val allocationClientMock = mock[ExecutorAllocationClient]
     when(allocationClientMock.killExecutors(any(), any(), any(), 
any())).thenReturn(Seq("called"))
-    when(allocationClientMock.killExecutorsOnHost("hostA")).thenAnswer(new 
Answer[Boolean] {
-      // To avoid a race between blacklisting and killing, it is important 
that the nodeBlacklist
-      // is updated before we ask the executor allocation client to kill all 
the executors
-      // on a particular host.
-      override def answer(invocation: InvocationOnMock): Boolean = {
-        if (blacklist.nodeBlacklist.contains("hostA") == false) {
-          throw new IllegalStateException("hostA should be on the blacklist")
-        }
+    when(allocationClientMock.killExecutorsOnHost("hostA")).thenAnswer((_: 
InvocationOnMock) =>
+      if (blacklist.nodeBlacklist.contains("hostA")) {
 
 Review comment:
   Now I am quite sure it is deleted on purpose. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to