HeartSaVioR commented on a change in pull request #25725: 
[SPARK-24663][STREAMING][TESTS] StreamingContextSuite: Wait until slow receiver 
has been initialized, but with hard timeout
URL: https://github.com/apache/spark/pull/25725#discussion_r323022352
 
 

 ##########
 File path: 
streaming/src/test/scala/org/apache/spark/streaming/StreamingContextSuite.scala
 ##########
 @@ -974,6 +977,7 @@ class SlowTestReceiver(totalRecords: Int, 
recordsPerSecond: Int)
     }
     receivingThreadOption = Some(thread)
     thread.start()
+    SlowTestReceiver.initialized = true
 
 Review comment:
   I guess we can't access these flags if we place them in instance - as the 
receiver will be executed in executor (say, different JVM, or at least, 
serialized - deserialized even in test). So exposing them in object is really a 
hack only for testing.
   
   Btw, `receivedAllRecords` is actually not needed to be exposed as outside, 
as we create new receiver instance and we can just set the default value to 
false. If we move it, we can either remove hack entirely via adding more 
verbose code or keep the hack for concise code change.
   
   I'll move out receivedAllRecords for now: please let me know if you prefer 
to remove the hack, then I'll make a change.

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