Skip to content

Commit 3695ba5

Browse files
jiangxb1987HyukjinKwon
authored andcommitted
[MINOR][CORE][TEST] Fix afterEach() in TastSetManagerSuite and TaskSchedulerImplSuite
## What changes were proposed in this pull request? In the `afterEach()` method of both `TastSetManagerSuite` and `TaskSchedulerImplSuite`, `super.afterEach()` shall be called at the end, because it shall stop the SparkContext. https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/93706/testReport/org.apache.spark.scheduler/TaskSchedulerImplSuite/_It_is_not_a_test_it_is_a_sbt_testing_SuiteSelector_/ The test failure is caused by the above reason, the newly added `barrierCoordinator` required `rpcEnv` which has been stopped before `TaskSchedulerImpl` doing cleanup. ## How was this patch tested? Existing tests. Author: Xingbo Jiang <[email protected]> Closes apache#21908 from jiangxb1987/afterEach.
1 parent 2c54aae commit 3695ba5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B
6262
}
6363

6464
override def afterEach(): Unit = {
65-
super.afterEach()
6665
if (taskScheduler != null) {
6766
taskScheduler.stop()
6867
taskScheduler = null
@@ -71,6 +70,7 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B
7170
dagScheduler.stop()
7271
dagScheduler = null
7372
}
73+
super.afterEach()
7474
}
7575

7676
def setupScheduler(confs: (String, String)*): TaskSchedulerImpl = {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,12 @@ class TaskSetManagerSuite extends SparkFunSuite with LocalSparkContext with Logg
178178
}
179179

180180
override def afterEach(): Unit = {
181-
super.afterEach()
182181
if (sched != null) {
183182
sched.dagScheduler.stop()
184183
sched.stop()
185184
sched = null
186185
}
186+
super.afterEach()
187187
}
188188

189189

0 commit comments

Comments
 (0)