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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]