spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject spark git commit: [HOTFIX][SQL] Fix broken cached test
Date Thu, 23 Apr 2015 05:18:58 GMT
Repository: spark
Updated Branches:
  refs/heads/master 03e85b4a1 -> d9e70f331


[HOTFIX][SQL] Fix broken cached test

Added in #5475. Pointed as broken in #5639.
/cc marmbrus

Author: Liang-Chi Hsieh <viirya@gmail.com>

Closes #5640 from viirya/fix_cached_test and squashes the following commits:

c0cf69a [Liang-Chi Hsieh] Fix broken cached test.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/d9e70f33
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/d9e70f33
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/d9e70f33

Branch: refs/heads/master
Commit: d9e70f331fc3999d615ede49fc69a993dc65f272
Parents: 03e85b4
Author: Liang-Chi Hsieh <viirya@gmail.com>
Authored: Wed Apr 22 22:18:56 2015 -0700
Committer: Tathagata Das <tathagata.das1565@gmail.com>
Committed: Wed Apr 22 22:18:56 2015 -0700

----------------------------------------------------------------------
 .../org/apache/spark/sql/CachedTableSuite.scala | 21 +++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/d9e70f33/sql/core/src/test/scala/org/apache/spark/sql/CachedTableSuite.scala
----------------------------------------------------------------------
diff --git a/sql/core/src/test/scala/org/apache/spark/sql/CachedTableSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/CachedTableSuite.scala
index 01e3b86..0772e5e 100644
--- a/sql/core/src/test/scala/org/apache/spark/sql/CachedTableSuite.scala
+++ b/sql/core/src/test/scala/org/apache/spark/sql/CachedTableSuite.scala
@@ -300,19 +300,26 @@ class CachedTableSuite extends QueryTest {
   }
 
   test("Clear accumulators when uncacheTable to prevent memory leaking") {
-    val accsSize = Accumulators.originals.size
-
     sql("SELECT key FROM testData LIMIT 10").registerTempTable("t1")
     sql("SELECT key FROM testData LIMIT 5").registerTempTable("t2")
-    cacheTable("t1")
-    cacheTable("t2")
+
+    Accumulators.synchronized {
+      val accsSize = Accumulators.originals.size
+      cacheTable("t1")
+      cacheTable("t2")
+      assert((accsSize + 2) == Accumulators.originals.size)
+    }
+
     sql("SELECT * FROM t1").count()
     sql("SELECT * FROM t2").count()
     sql("SELECT * FROM t1").count()
     sql("SELECT * FROM t2").count()
-    uncacheTable("t1")
-    uncacheTable("t2")
 
-    assert(accsSize >= Accumulators.originals.size)
+    Accumulators.synchronized {
+      val accsSize = Accumulators.originals.size
+      uncacheTable("t1")
+      uncacheTable("t2")
+      assert((accsSize - 2) == Accumulators.originals.size)
+    }
   }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org


Mime
View raw message