HeartSaVioR commented on a change in pull request #25048: [SPARK-28247][SS] Fix 
flaky test "query without test harness" on ContinuousSuite 
URL: https://github.com/apache/spark/pull/25048#discussion_r300515807
 
 

 ##########
 File path: 
sql/core/src/test/scala/org/apache/spark/sql/streaming/continuous/ContinuousSuite.scala
 ##########
 @@ -38,18 +38,42 @@ class ContinuousSuiteBase extends StreamTest {
       sparkConf.set("spark.sql.testkey", "true")))
 
   protected def waitForRateSourceTriggers(query: StreamExecution, numTriggers: 
Int): Unit = {
-    query match {
+    findRateStreamContinuousStream(query).foreach { reader =>
+      val deltaMs = numTriggers * 1000 + 300
+      val firstCommittedTime = reader.firstCommittedTime.longValue()
 
 Review comment:
   This change is based on the observation: while `reader.creationTime` doesn't 
guarantee partition readers are initialized. Instead, 
`reader.firstCommittedTime` guarantees partition readers are initialized 
before, so we can capture and use this.
   (This is a best-effort on driver side, not fastest approach, of course.)

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

Reply via email to