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_r363927914
##########
File path: core/src/test/scala/org/apache/spark/scheduler/FakeTask.scala
##########
@@ -36,34 +36,71 @@ class FakeTask(
override def preferredLocations: Seq[TaskLocation] = prefLocs
}
+class FakeLongTasks(
+ stageId: Int,
+ partitionId: Int,
+ prefLocs: Seq[TaskLocation] = Nil,
+ serializedTaskMetrics: Array[Byte] =
+
SparkEnv.get.closureSerializer.newInstance().serialize(TaskMetrics.registered).array(),
+ isBarrier: Boolean = false)
+ extends FakeTask(stageId, partitionId, prefLocs, serializedTaskMetrics,
isBarrier) {
+
+ override def runTask(context: TaskContext): Int = {
+ while (true) {
+ Thread.sleep(10000)
+ }
+ 0
+ }
+}
+
object FakeTask {
/**
* Utility method to create a TaskSet, potentially setting a particular
sequence of preferred
* locations for each task (given as varargs) if this sequence is not empty.
*/
def createTaskSet(numTasks: Int, prefLocs: Seq[TaskLocation]*): TaskSet = {
- createTaskSet(numTasks, stageId = 0, stageAttemptId = 0, priority = 0,
prefLocs: _*)
+ createTaskSet(numTasks, 0, 0, 0, false, prefLocs: _*)
+ }
+
+ def createTaskSetLongRunning(numTasks: Int, prefLocs: Seq[TaskLocation]*):
TaskSet = {
+ createTaskSet(numTasks, 0, 0, 0, true, prefLocs: _*)
Review comment:
updated
----------------------------------------------------------------
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]