Github user kayousterhout commented on a diff in the pull request:
https://github.com/apache/spark/pull/13848#discussion_r68635755
--- Diff:
core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala ---
@@ -157,14 +157,27 @@ class TaskSetManagerSuite extends SparkFunSuite with
LocalSparkContext with Logg
val LOCALITY_WAIT_MS = conf.getTimeAsMs("spark.locality.wait", "3s")
val MAX_TASK_FAILURES = 4
- override def beforeEach() {
+ var sched: FakeTaskScheduler = null
+
+ override def beforeEach(): Unit = {
super.beforeEach()
FakeRackUtil.cleanUp()
+ sched = null
+ }
+
+ override def afterEach(): Unit = {
+ super.afterEach()
+ if (sched != null) {
+ sched.dagScheduler.stop()
+ sched.stop()
+ sched = null
+ }
}
+
test("TaskSet with no preferences") {
sc = new SparkContext("local", "test")
- val sched = new FakeTaskScheduler(sc, ("exec1", "host1"))
+ sched = new FakeTaskScheduler(sc, ("exec1", "host1"))
--- End diff --
Is this change b/c otherwise the FakeTaskScheduler threads don't get
cleaned up correctly between tests?
---
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]