Skip to content
Snippets Groups Projects
Commit d911c682 authored by robbins's avatar robbins Committed by Andrew Or
Browse files

[SPARK-10431] [CORE] Fix intermittent test failure. Wait for event queue to be clear

Author: robbins <robbins@uk.ibm.com>

Closes #8582 from robbinspg/InputOutputMetricsSuite.
parent 49aff7b9
No related branches found
No related tags found
No related merge requests found
......@@ -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 += _)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment