Repository: spark
Updated Branches:
  refs/heads/branch-1.3 b34b5bdf5 -> 9278b7a6a


[SPARK-5074] [CORE] [TESTS] Fix the flakey test 'run shuffle with map stage 
failure' in DAGSchedulerSuite

Test failure: 
https://amplab.cs.berkeley.edu/jenkins/job/Spark-Master-SBT/AMPLAB_JENKINS_BUILD_PROFILE=hadoop2.2,label=centos/2240/testReport/junit/org.apache.spark.scheduler/DAGSchedulerSuite/run_shuffle_with_map_stage_failure/

This is because many tests share the same `JobListener`. Because after each 
test, `scheduler` isn't stopped. So actually it's still running. When running 
the test `run shuffle with map stage failure`, some previous test may trigger 
[ResubmitFailedStages](https://github.com/apache/spark/blob/ebc25a4ddfe07a67668217cec59893bc3b8cf730/core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala#L1120)
 logic, and report `jobFailed` and override the global `failure` variable.

This PR uses `after` to call `scheduler.stop()` for each test.

Author: zsxwing <zsxw...@gmail.com>

Closes #5903 from zsxwing/SPARK-5074 and squashes the following commits:

1e6f13e [zsxwing] Fix the flakey test 'run shuffle with map stage failure' in 
DAGSchedulerSuite

(cherry picked from commit 5ffc73e68b3a6ea30c25931e9e0495a4c7e5654c)
Signed-off-by: Sean Owen <so...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/9278b7a6
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/9278b7a6
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/9278b7a6

Branch: refs/heads/branch-1.3
Commit: 9278b7a6afa68f3f6f85b8f7c0926f1ff97b521c
Parents: b34b5bd
Author: zsxwing <zsxw...@gmail.com>
Authored: Tue May 5 15:04:14 2015 +0100
Committer: Sean Owen <so...@cloudera.com>
Committed: Tue May 5 15:05:45 2015 +0100

----------------------------------------------------------------------
 .../scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala  | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/9278b7a6/core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala
----------------------------------------------------------------------
diff --git 
a/core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala 
b/core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala
index 06586aa..a62a8d9 100644
--- a/core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala
+++ b/core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala
@@ -175,6 +175,10 @@ class DAGSchedulerSuite extends FunSuiteLike  with 
BeforeAndAfter with LocalSpar
     dagEventProcessLoopTester = new 
DAGSchedulerEventProcessLoopTester(scheduler)
   }
 
+  after {
+    scheduler.stop()
+  }
+
   override def afterAll() {
     super.afterAll()
   }
@@ -261,8 +265,9 @@ class DAGSchedulerSuite extends FunSuiteLike  with 
BeforeAndAfter with LocalSpar
       override def taskSucceeded(partition: Int, value: Any) = numResults += 1
       override def jobFailed(exception: Exception) = throw exception
     }
-    submit(new MyRDD(sc, 0, Nil), Array(), listener = fakeListener)
+    val jobId = submit(new MyRDD(sc, 0, Nil), Array(), listener = fakeListener)
     assert(numResults === 0)
+    cancel(jobId)
   }
 
   test("run trivial job") {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to