ajithme commented on a change in pull request #27115: 
[SPARK-30440][CORE][TESTS] Flaky test: 
org.apache.spark.scheduler.TaskSetManagerSuite
URL: https://github.com/apache/spark/pull/27115#discussion_r364195466
 
 

 ##########
 File path: 
core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala
 ##########
 @@ -1928,11 +1927,15 @@ class TaskSetManagerSuite
     // get the TaskSetManager
     val manager = 
sched.invokePrivate(taskSetManagers()).get(stageId).get(stageAttemptId)
 
-    val task0 = manager.resourceOffer(exec0, "localhost", TaskLocality.NO_PREF)
-    val task1 = manager.resourceOffer(exec1, "localhost", TaskLocality.NO_PREF)
-    assert(task0.isDefined && task1.isDefined)
-    val (taskId0, index0) = (task0.get.taskId, task0.get.index)
-    val (taskId1, index1) = (task1.get.taskId, task1.get.index)
+    val (task0, task1) = eventually(timeout(10.seconds), 
interval(100.milliseconds)) {
 
 Review comment:
   As `org.apache.spark.scheduler.TaskSetManager#taskInfos` will be filled in 
the actual scheduling cycle via 
`org.apache.spark.scheduler.TaskSetManager#resourceOffer` this eventual loops 
just waits for it to be scheduled

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