You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/04/03 18:52:18 UTC

[GitHub] [spark] sumeetgajjar commented on a change in pull request #32043: [SPARK-34949][CORE] Prevent BlockManager reregister when Executor is shutting down

sumeetgajjar commented on a change in pull request #32043:
URL: https://github.com/apache/spark/pull/32043#discussion_r606697589



##########
File path: core/src/test/scala/org/apache/spark/executor/ExecutorSuite.scala
##########
@@ -270,29 +270,36 @@ class ExecutorSuite extends SparkFunSuite
     heartbeatZeroAccumulatorUpdateTest(false)
   }
 
+  private def withMockHeartbeatReceiverRef(executor: Executor)
+                                          (func: RpcEndpointRef => Unit): Unit = {
+    val executorClass = classOf[Executor]
+    val mockReceiverRef = mock[RpcEndpointRef]
+    val receiverRef = executorClass.getDeclaredField("heartbeatReceiverRef")
+    receiverRef.setAccessible(true)
+    receiverRef.set(executor, mockReceiverRef)
+
+    func(mockReceiverRef)
+  }
+
   private def withHeartbeatExecutor(confs: (String, String)*)
-      (f: (Executor, ArrayBuffer[Heartbeat]) => Unit): Unit = {
+                                   (f: (Executor, ArrayBuffer[Heartbeat]) => Unit): Unit = {

Review comment:
       Done. 




-- 
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org