Github user squito commented on a diff in the pull request:
https://github.com/apache/spark/pull/16346#discussion_r95725456
--- Diff:
core/src/test/scala/org/apache/spark/scheduler/BlacklistTrackerSuite.scala ---
@@ -88,6 +88,86 @@ class BlacklistTrackerSuite extends SparkFunSuite with
BeforeAndAfterEach with M
new TaskSetBlacklist(conf, stageId, clock)
}
+ def configureBlacklistAndScheduler(confs: (String, String)*): Unit = {
+ conf = new SparkConf().setAppName("test").setMaster("local")
+ .set(config.BLACKLIST_ENABLED.key, "true")
+ confs.foreach { case (k, v) => conf.set(k, v) }
+
+ clock.setTime(0)
+ listenerBusMock = mock[LiveListenerBus]
+ blacklist = new BlacklistTracker(listenerBusMock, conf, clock)
+ }
+
+ test("Blacklisting individual tasks and checking for
SparkListenerEvents") {
+ configureBlacklistAndScheduler()
--- End diff --
I think the rest of the test code here has changed a lot since you first
started working on this, but I'd avoid putting in a whole test case just for
this. Instead, I'd look at the existing test cases, find all occurrences of
`blacklist.isNodeBlacklisted` and `blacklist.isExecutorBlacklisted`, and add
appropriate `verify(listenerBusMock)` calls around all of those.
---
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]