Skip to content

Commit 6b9ded4

Browse files
committed
revert back the extra test to TaskSetManagerSuite as per @Ngone51
1 parent 9389ed5 commit 6b9ded4

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,8 +1033,7 @@ private[spark] class TaskSetManager(
10331033
// No need to speculate if the task set is zombie or is from a barrier stage. If there is only
10341034
// one task we don't speculate since we don't have metrics to decide whether it's taking too
10351035
// long or not, unless a task duration threshold is explicitly provided.
1036-
if (!speculationEnabled || isZombie || isBarrier ||
1037-
(numTasks == 1 && !speculationTaskDurationThresOpt.isDefined)) {
1036+
if (isZombie || isBarrier || (numTasks == 1 && !speculationTaskDurationThresOpt.isDefined)) {
10381037
return false
10391038
}
10401039
var foundTasks = false

core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2086,27 +2086,6 @@ class TaskSetManagerSuite
20862086
assert(manager.resourceOffer("exec1", "host1", ANY)._1.isEmpty)
20872087
}
20882088

2089-
test("Check that speculation does not happen when disabled") {
2090-
sc = new SparkContext("local", "test")
2091-
val clock = new ManualClock()
2092-
sched = new FakeTaskScheduler(sc, clock,
2093-
("exec1", "host1"), ("exec2", "host2"), ("exec3", "host3"))
2094-
sched.backend = mock(classOf[SchedulerBackend])
2095-
val taskSet = FakeTask.createTaskSet(1)
2096-
sc.conf.set(config.SPECULATION_ENABLED, false)
2097-
val manager = sched.createTaskSetManager(taskSet, MAX_TASK_FAILURES)
2098-
val taskOption = manager.resourceOffer("exec1", "host1", NO_PREF)._1
2099-
assert(taskOption.isDefined)
2100-
assert(taskOption.get.executorId === "exec1")
2101-
assert(taskOption.get.index === 0)
2102-
assert(sched.startedTasks.toSet === Set(0))
2103-
assert(manager.copiesRunning(0) === 1)
2104-
2105-
// Speculation is disabled so nothing should be speculated.
2106-
assert(!manager.checkSpeculatableTasks(0))
2107-
assert(sched.speculativeTasks.toSet === Set())
2108-
}
2109-
21102089
test("SPARK-29976 Regular speculation configs should still take effect even when a " +
21112090
"threshold is provided") {
21122091
val (manager, clock) = testSpeculationDurationSetup(

0 commit comments

Comments
 (0)