You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by squito <gi...@git.apache.org> on 2016/06/01 20:14:49 UTC
[GitHub] spark pull request #12951: [SPARK-15176][Core] Add maxShares setting to Pool...
Github user squito commented on a diff in the pull request:
https://github.com/apache/spark/pull/12951#discussion_r65433748
--- Diff: core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala ---
@@ -316,6 +316,36 @@ class TaskSetManagerSuite extends SparkFunSuite with LocalSparkContext with Logg
assert(manager.resourceOffer("exec2", "host2", ANY).get.index === 3)
}
+ test("Scheduler respects maxRunningTasks setting of its pool") {
+ sc = new SparkContext("local", "test")
+ val sched = new FakeTaskScheduler(sc, ("exec1", "host1"))
+ val taskSet = FakeTask.createTaskSet(5)
+ val clock = new ManualClock
+ val manager = new TaskSetManager(sched, taskSet, MAX_TASK_FAILURES, clock)
+ manager.parent = new Pool("pool", SchedulingMode.FAIR, 0, 2, 0)
+
+ // pool has two tasks...
+ assert(manager.resourceOffer("exec1", "host1", ANY).get.index === 0)
+ assert(manager.resourceOffer("exec1", "host1", ANY).get.index === 1)
+
+ // but not three!
+ assert(manager.resourceOffer("exec1", "host1", ANY).isEmpty)
+
--- End diff --
The test case should include scheduling another taskset to a different pool which does not share the limitation, and making sure it can still schedule tasks even when the first task set gets limited.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org