Github user smurakozi commented on a diff in the pull request:
https://github.com/apache/spark/pull/20203#discussion_r161009908
--- Diff:
core/src/test/scala/org/apache/spark/scheduler/TaskSetBlacklistSuite.scala ---
@@ -157,13 +187,19 @@ class TaskSetBlacklistSuite extends SparkFunSuite {
// lead to any node blacklisting
val conf = new SparkConf().setAppName("test").setMaster("local")
.set(config.BLACKLIST_ENABLED.key, "true")
- val taskSetBlacklist = new TaskSetBlacklist(conf, stageId = 0, new
SystemClock())
+ val clock = new ManualClock
+
+ val attemptId = 0
+ val taskSetBlacklist = new TaskSetBlacklist(
+ listenerBusMock, conf, stageId = 0, stageAttemptId = attemptId,
clock = clock)
+ clock.setTime(0)
taskSetBlacklist.updateBlacklistForFailedTask(
"hostA", exec = "1", index = 0, failureReason = "testing")
taskSetBlacklist.updateBlacklistForFailedTask(
"hostA", exec = "1", index = 1, failureReason = "testing")
assert(taskSetBlacklist.isExecutorBlacklistedForTaskSet("1"))
assert(!taskSetBlacklist.isNodeBlacklistedForTaskSet("hostA"))
+
verify(listenerBusMock).post(SparkListenerExecutorBlacklistedForStage(0, "1",
2, 0, attemptId))
taskSetBlacklist.updateBlacklistForFailedTask(
--- End diff --
Set time to new value before this call.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]