dongjoon-hyun commented on a change in pull request #25862: 
[SPARK-23197][STREAMING][TESTS] Fix ReceiverSuite."receiver_life_cycle" to not 
rely on timing
URL: https://github.com/apache/spark/pull/25862#discussion_r326465739
 
 

 ##########
 File path: 
streaming/src/test/scala/org/apache/spark/streaming/ReceiverSuite.scala
 ##########
 @@ -106,19 +106,22 @@ class ReceiverSuite extends TestSuiteBase with 
TimeLimits with Serializable {
     assert(executor.errors.head.eq(exception))
 
     // Verify restarting actually stops and starts the receiver
-    receiver.restart("restarting", null, 600)
-    eventually(timeout(300.milliseconds), interval(10.milliseconds)) {
-      // receiver will be stopped async
-      assert(receiver.isStopped)
-      assert(receiver.onStopCalled)
-    }
-    eventually(timeout(1.second), interval(10.milliseconds)) {
-      // receiver will be started async
-      assert(receiver.onStartCalled)
-      assert(executor.isReceiverStarted)
+    executor.callsRecorder.reset()
+    receiver.callsRecorder.reset()
+    receiver.restart("restarting", null, 100)
+    eventually(timeout(10.seconds), interval(10.milliseconds)) {
 
 Review comment:
   So, `10.seconds` is enough? Do you need to retriever this PR to validate 
more?
   BTW, thank you so much for taking care of this case!

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


With regards,
Apache Git Services

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

Reply via email to