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_r364258597
 
 

 ##########
 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)) {
+      val task0 = Option(manager.taskInfos(0))
+      val task1 = Option(manager.taskInfos(1))
+      assert(task0.isDefined && task1.isDefined)
+      (task0, task1)
+    }
+
+    val (taskId0, index0, exec0) = (task0.get.taskId, task0.get.index, 
task0.get.executorId)
+    val (taskId1, index1, exec1) = (task1.get.taskId, task1.get.index, 
task1.get.executorId)
     // set up two running tasks
     assert(manager.taskInfos(taskId0).running)
     assert(manager.taskInfos(taskId0).executorId === exec0)
 
 Review comment:
   removed now

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