Repository: spark Updated Branches: refs/heads/master d3180c25d -> beb8bc1ea
[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 <[email protected]> Closes #9163 from zsxwing/SPARK-11126-follow-up. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/beb8bc1e Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/beb8bc1e Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/beb8bc1e Branch: refs/heads/master Commit: beb8bc1ea588b7f9ab7effff707c0f784421364d Parents: d3180c2 Author: zsxwing <[email protected]> Authored: Mon Oct 19 00:06:51 2015 -0700 Committer: Josh Rosen <[email protected]> Committed: Mon Oct 19 00:06:51 2015 -0700 ---------------------------------------------------------------------- .../scala/org/apache/spark/sql/execution/ui/SQLListenerSuite.scala | 2 ++ 1 file changed, 2 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/beb8bc1e/sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLListenerSuite.scala ---------------------------------------------------------------------- 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 03bcee9..c15aac7 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) } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
