aboutsummaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorzsxwing <zsxwing@gmail.com>2015-10-19 00:06:51 -0700
committerJosh Rosen <joshrosen@databricks.com>2015-10-19 00:06:51 -0700
commitbeb8bc1ea588b7f9ab7effff707c0f784421364d (patch)
treec698706668f259f87262d6b98955935db4a68a0c /sql
parentd3180c25d8cf0899a7238e7d24b35c5ae918cc1d (diff)
downloadspark-beb8bc1ea588b7f9ab7effff707c0f784421364d.tar.gz
spark-beb8bc1ea588b7f9ab7effff707c0f784421364d.tar.bz2
spark-beb8bc1ea588b7f9ab7effff707c0f784421364d.zip
[SPARK-11126][SQL] Fix the potential flaky test
The unit test added in #9132 is flaky. This is a follow up PR to add `listenerBus.waitUntilEmpty` to fix it. Author: zsxwing <zsxwing@gmail.com> Closes #9163 from zsxwing/SPARK-11126-follow-up.
Diffstat (limited to 'sql')
-rw-r--r--sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLListenerSuite.scala2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLListenerSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLListenerSuite.scala
index 03bcee94a2..c15aac7750 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLListenerSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLListenerSuite.scala
@@ -316,10 +316,12 @@ class SQLListenerSuite extends SparkFunSuite with SharedSQLContext {
test("SPARK-11126: no memory leak when running non SQL jobs") {
val previousStageNumber = sqlContext.listener.stageIdToStageMetrics.size
sqlContext.sparkContext.parallelize(1 to 10).foreach(i => ())
+ sqlContext.sparkContext.listenerBus.waitUntilEmpty(10000)
// listener should ignore the non SQL stage
assert(sqlContext.listener.stageIdToStageMetrics.size == previousStageNumber)
sqlContext.sparkContext.parallelize(1 to 10).toDF().foreach(i => ())
+ sqlContext.sparkContext.listenerBus.waitUntilEmpty(10000)
// listener should save the SQL stage
assert(sqlContext.listener.stageIdToStageMetrics.size == previousStageNumber + 1)
}