diff options
author | Matei Zaharia <matei@eecs.berkeley.edu> | 2013-11-26 19:07:20 -0800 |
---|---|---|
committer | Matei Zaharia <matei@eecs.berkeley.edu> | 2013-11-26 19:07:20 -0800 |
commit | 615213fb82812003529367b2a8dff25b66362a1a (patch) | |
tree | 7cd3fc95b030ef114cdd46bac857c4af9aa8e30c | |
parent | cb976dfb50d62b8a686b6249ff3b24c0837bd613 (diff) | |
parent | ed7ecb93ce6ce259eae1f5aeb28e9e336fafa30f (diff) | |
download | spark-615213fb82812003529367b2a8dff25b66362a1a.tar.gz spark-615213fb82812003529367b2a8dff25b66362a1a.tar.bz2 spark-615213fb82812003529367b2a8dff25b66362a1a.zip |
Merge pull request #212 from markhamstra/SPARK-963
[SPARK-963] Fixed races in JobLoggerSuite
-rw-r--r-- | core/src/test/scala/org/apache/spark/scheduler/JobLoggerSuite.scala | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/src/test/scala/org/apache/spark/scheduler/JobLoggerSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/JobLoggerSuite.scala index 984881861c..002368ff55 100644 --- a/core/src/test/scala/org/apache/spark/scheduler/JobLoggerSuite.scala +++ b/core/src/test/scala/org/apache/spark/scheduler/JobLoggerSuite.scala @@ -31,6 +31,7 @@ import org.apache.spark.rdd.RDD class JobLoggerSuite extends FunSuite with LocalSparkContext with ShouldMatchers { + val WAIT_TIMEOUT_MILLIS = 10000 test("inner method") { sc = new SparkContext("local", "joblogger") @@ -92,6 +93,8 @@ class JobLoggerSuite extends FunSuite with LocalSparkContext with ShouldMatchers val rdd = sc.parallelize(1 to 1e2.toInt, 4).map{ i => (i % 12, 2 * i) } rdd.reduceByKey(_+_).collect() + assert(sc.dagScheduler.listenerBus.waitUntilEmpty(WAIT_TIMEOUT_MILLIS)) + val user = System.getProperty("user.name", SparkContext.SPARK_UNKNOWN_USER) joblogger.getLogDir should be ("/tmp/spark-%s".format(user)) @@ -120,7 +123,9 @@ class JobLoggerSuite extends FunSuite with LocalSparkContext with ShouldMatchers sc.addSparkListener(joblogger) val rdd = sc.parallelize(1 to 1e2.toInt, 4).map{ i => (i % 12, 2 * i) } rdd.reduceByKey(_+_).collect() - + + assert(sc.dagScheduler.listenerBus.waitUntilEmpty(WAIT_TIMEOUT_MILLIS)) + joblogger.onJobStartCount should be (1) joblogger.onJobEndCount should be (1) joblogger.onTaskEndCount should be (8) |