Ngone51 commented on a change in pull request #29452:
URL: https://github.com/apache/spark/pull/29452#discussion_r473727286



##########
File path: 
core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala
##########
@@ -120,6 +121,10 @@ class FakeTaskScheduler(sc: SparkContext, liveExecutors: 
(String, String)* /* ex
 
   val executors = new mutable.HashMap[String, String]
 
+  def this(sc: SparkContext, liveExecutors: (String, String)*) {

Review comment:
       nit: `) = {`?

##########
File path: 
core/src/test/scala/org/apache/spark/scheduler/TaskSchedulerImplSuite.scala
##########
@@ -1820,52 +1820,56 @@ class TaskSchedulerImplSuite extends SparkFunSuite with 
LocalSparkContext with B
     taskScheduler
   }
 
-  test("scheduler should keep the decommission info where host was 
decommissioned") {
+  test("scheduler should keep the decommission state where host was 
decommissioned") {
     val scheduler = setupSchedulerForDecommissionTests(new SystemClock)
 
     scheduler.executorDecommission("executor0", ExecutorDecommissionInfo("0", 
false))
     scheduler.executorDecommission("executor1", ExecutorDecommissionInfo("1", 
true))
     scheduler.executorDecommission("executor0", ExecutorDecommissionInfo("0 
new", false))
     scheduler.executorDecommission("executor1", ExecutorDecommissionInfo("1 
new", false))
 
-    assert(scheduler.getExecutorDecommissionInfo("executor0")
+    def convert(state: Option[ExecutorDecommissionState]): 
Option[ExecutorDecommissionInfo] =
+      state.map(s => ExecutorDecommissionInfo(s.message, 
s.isHostDecommissioned))
+
+    assert(convert(scheduler.getExecutorDecommissionState("executor0"))

Review comment:
       Why not just compare with the state?

##########
File path: 
core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala
##########
@@ -109,8 +109,9 @@ object FakeRackUtil {
  * a list of "live" executors and their hostnames for isExecutorAlive and 
hasExecutorsAliveOnHost
  * to work, and these are required for locality in TaskSetManager.
  */
-class FakeTaskScheduler(sc: SparkContext, liveExecutors: (String, String)* /* 
execId, host */)
-  extends TaskSchedulerImpl(sc)
+class FakeTaskScheduler(sc: SparkContext, clock: Clock,
+                        liveExecutors: (String, String)* /* execId, host */)

Review comment:
       nit: style




----------------------------------------------------------------
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]



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

Reply via email to