Github user jsoltren commented on a diff in the pull request:
https://github.com/apache/spark/pull/16650#discussion_r99660675
--- Diff:
core/src/test/scala/org/apache/spark/deploy/StandaloneDynamicAllocationSuite.scala
---
@@ -489,6 +491,29 @@ class StandaloneDynamicAllocationSuite
}
}
+ 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"))
+ when(taskScheduler.sc).thenReturn(sc)
+ sc.taskScheduler = taskScheduler
+
+ // Create a fresh scheduler backend to blacklist "localhost".
+ sc.schedulerBackend.stop()
+ val backend =
+ new StandaloneSchedulerBackend(taskScheduler, sc,
Array(masterRpcEnv.address.toSparkURL))
+ backend.start()
+
+ backend.driverEndpoint.ask[Boolean](message)
+ verify(endpointRef).send(RegisterExecutorFailed(any()))
--- End diff --
Thanks for the tip. Fixed.
---
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]