Github user mccheah commented on a diff in the pull request:
https://github.com/apache/spark/pull/8007#discussion_r39112877
--- Diff:
core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala ---
@@ -504,13 +504,36 @@ class TaskSetManagerSuite extends SparkFunSuite with
LocalSparkContext with Logg
Array(PROCESS_LOCAL, NODE_LOCAL, NO_PREF, RACK_LOCAL, ANY)))
// test if the valid locality is recomputed when the executor is lost
sched.removeExecutor("execC")
- manager.executorLost("execC", "host2")
+ manager.executorLost("execC", "host2", SlaveLost())
assert(manager.myLocalityLevels.sameElements(Array(NODE_LOCAL,
NO_PREF, ANY)))
sched.removeExecutor("execD")
- manager.executorLost("execD", "host1")
+ manager.executorLost("execD", "host1", SlaveLost())
assert(manager.myLocalityLevels.sameElements(Array(NO_PREF, ANY)))
}
+ test("Executors are added but exit normally while running tasks") {
+ sc = new SparkContext("local", "test")
+ val sched = new FakeTaskScheduler(sc)
+ val taskSet = FakeTask.createTaskSet(4,
+ Seq(TaskLocation("host1", "execA")),
+ Seq(TaskLocation("host1", "execB")),
+ Seq(TaskLocation("host2", "execC")),
+ Seq())
+ val manager = new TaskSetManager(sched, taskSet, 1, new ManualClock)
+ sched.addExecutor("execA", "host1")
+ manager.executorAdded()
+ sched.addExecutor("execC", "host2")
+ manager.executorAdded()
+ assert(manager.resourceOffer("exec1", "host1", ANY).isDefined)
+ sched.removeExecutor("execA")
+ manager.executorLost("execA", "host1", ExecutorExited(143, true,
"Normal termination"))
+ assert(!sched.taskSetsFailed.contains(taskSet.id))
--- End diff --
By setting maxTaskFailures to 1 I'm effectively testing that case too,
right?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]