Repository: spark Updated Branches: refs/heads/branch-1.5 f945b641c -> 4d6333597
[SPARK-10431] [CORE] Fix intermittent test failure. Wait for event queue to be clear Author: robbins <[email protected]> Closes #8582 from robbinspg/InputOutputMetricsSuite. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/4d633359 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/4d633359 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/4d633359 Branch: refs/heads/branch-1.5 Commit: 4d63335972eb7167c3c53db64a1e47fd24875287 Parents: f945b64 Author: robbins <[email protected]> Authored: Thu Sep 3 13:47:22 2015 -0700 Committer: Andrew Or <[email protected]> Committed: Thu Sep 3 13:50:03 2015 -0700 ---------------------------------------------------------------------- .../scala/org/apache/spark/metrics/InputOutputMetricsSuite.scala | 4 ++++ 1 file changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/4d633359/core/src/test/scala/org/apache/spark/metrics/InputOutputMetricsSuite.scala ---------------------------------------------------------------------- diff --git a/core/src/test/scala/org/apache/spark/metrics/InputOutputMetricsSuite.scala b/core/src/test/scala/org/apache/spark/metrics/InputOutputMetricsSuite.scala index d3218a5..44eb5a0 100644 --- a/core/src/test/scala/org/apache/spark/metrics/InputOutputMetricsSuite.scala +++ b/core/src/test/scala/org/apache/spark/metrics/InputOutputMetricsSuite.scala @@ -286,6 +286,10 @@ class InputOutputMetricsSuite extends SparkFunSuite with SharedSparkContext private def runAndReturnMetrics(job: => Unit, collector: (SparkListenerTaskEnd) => Option[Long]): Long = { val taskMetrics = new ArrayBuffer[Long]() + + // Avoid receiving earlier taskEnd events + sc.listenerBus.waitUntilEmpty(500) + sc.addSparkListener(new SparkListener() { override def onTaskEnd(taskEnd: SparkListenerTaskEnd) { collector(taskEnd).foreach(taskMetrics += _) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
