HeartSaVioR commented on a change in pull request #27004: [SPARK-30348][CORE] 
Fix flaky test failure on "MasterSuite.SPARK-27510: Master should avoid ..."
URL: https://github.com/apache/spark/pull/27004#discussion_r361229507
 
 

 ##########
 File path: core/src/test/scala/org/apache/spark/deploy/master/MasterSuite.scala
 ##########
 @@ -682,7 +682,11 @@ class MasterSuite extends SparkFunSuite
         // an app would be registered with Master once Driver set up
         assert(worker.apps.nonEmpty)
         appId = worker.apps.head._1
-        assert(master.idToApp.contains(appId))
+
+        // we found the case where the test was too fast which all steps were 
done within
+        // an interval - in this case, we have to check either app is 
available in master
+        // or marked as completed. See SPARK-30348 for details.
+        assert(master.idToApp.contains(appId) || 
master.completedApps.exists(_.id == appId))
 
 Review comment:
   I'd say the test was wrong as I added comment in code; the code is observing 
the state change on different thread which should be relying on listener stuff; 
if we can't receive updates via listener, we should take into account that we 
may not be able to capture the state change sequentially.
   
   Regarding adding delay I'll comment again, as Sean also commented that.

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