[GitHub] [spark] HeartSaVioR commented on a change in pull request #25862: [SPARK-23197][STREAMING][TESTS] Fix ReceiverSuite."receiver_life_cycle" to not rely on timing
HeartSaVioR 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_r328313468 ## 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) Review comment: Ah yes we no longer need so long delay as we don't rely on timing. 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
[GitHub] [spark] HeartSaVioR commented on a change in pull request #25862: [SPARK-23197][STREAMING][TESTS] Fix ReceiverSuite."receiver_life_cycle" to not rely on timing
HeartSaVioR 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_r326466225 ## 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: Yes that was actually 1.3 seconds (300ms + 1s) and it hasn't been failing for high probability so it should be pretty enough. 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