Github user mwws commented on a diff in the pull request:
https://github.com/apache/spark/pull/8760#discussion_r42217021
--- Diff:
core/src/test/scala/org/apache/spark/scheduler/BlacklistTrackerSuite.scala ---
@@ -0,0 +1,162 @@
+package org.apache.spark.scheduler
+
+import org.apache.spark.SparkFunSuite
+import org.scalatest.BeforeAndAfter
+import org.apache.spark.SparkConf
+import org.apache.spark.TaskEndReason
+import org.apache.spark.Success
+import org.apache.spark.ExceptionFailure
+import org.apache.spark.LocalSparkContext
+import org.apache.spark.SparkContext
+
+import org.mockito.Mockito.{when,spy}
+
+class BlacklistTrackerSuite extends SparkFunSuite with BeforeAndAfter with
LocalSparkContext {
+
+ val FAILURE: TaskEndReason = new ExceptionFailure(
+ "Fake",
+ "fake failure",
+ Array.empty[StackTraceElement],
+ "fake stack trace",
+ None,
+ None)
+
+ // Variable name can indicate basic information of taskInfo
+ // The format is "taskInfo_executorId_taskId_hostName"
+ val taskInfo_1_1_hostA = new TaskInfo(1L,1,1,0L,"1","hostA",
TaskLocality.ANY, false)
+ val taskInfo_1_2_hostA = new TaskInfo(2L,1,1,0L,"1","hostA",
TaskLocality.ANY, false)
+ val taskInfo_2_1_hostA = new TaskInfo(1L,1,1,0L,"2","hostA",
TaskLocality.ANY, false)
+ val taskInfo_2_2_hostA = new TaskInfo(2L,1,1,0L,"2","hostA",
TaskLocality.ANY, false)
+ val taskInfo_3_3_hostB = new TaskInfo(3L,1,1,0L,"3","hostB",
TaskLocality.ANY, false)
+
+ test ("expireExecutorsInBlacklist works ") {
+ val conf = new SparkConf().setAppName("test").setMaster("local")
+ .set("spark.ui.enabled","false")
+ .set("spark.scheduler.blacklist.recoverPeriod", "2")
+ sc = new SparkContext(conf)
+ val scheduler = new TaskSchedulerImpl(sc, 1)
+
+ val tracker = new BlacklistTracker(conf)
+ tracker.start()
+ Thread.sleep(100)
--- End diff --
Got it, thanks for the tips.
---
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]