aboutsummaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorReynold Xin <rxin@databricks.com>2015-02-04 19:52:41 -0800
committerReynold Xin <rxin@databricks.com>2015-02-04 19:52:41 -0800
commit206f9bc3622348926d73e43c8010519f7df9b34f (patch)
treea52ca46dc6079cb1d910faab99cb7b1096c63bdf /sql
parent6b4c7f08068b6099145ab039d0499e3fef68e2e9 (diff)
downloadspark-206f9bc3622348926d73e43c8010519f7df9b34f.tar.gz
spark-206f9bc3622348926d73e43c8010519f7df9b34f.tar.bz2
spark-206f9bc3622348926d73e43c8010519f7df9b34f.zip
[SPARK-5538][SQL] Fix flaky CachedTableSuite
Author: Reynold Xin <rxin@databricks.com> Closes #4379 from rxin/CachedTableSuite and squashes the following commits: f2b44ce [Reynold Xin] [SQL] Fix flaky CachedTableSuite.
Diffstat (limited to 'sql')
-rw-r--r--sql/core/src/test/scala/org/apache/spark/sql/CachedTableSuite.scala23
1 files changed, 19 insertions, 4 deletions
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 c9221f8f93..acb5677c4b 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
@@ -17,6 +17,12 @@
package org.apache.spark.sql
+import scala.concurrent.duration._
+import scala.language.implicitConversions
+import scala.language.postfixOps
+
+import org.scalatest.concurrent.Eventually._
+
import org.apache.spark.sql.TestData._
import org.apache.spark.sql.columnar._
import org.apache.spark.sql.Dsl._
@@ -191,7 +197,10 @@ class CachedTableSuite extends QueryTest {
sql("UNCACHE TABLE testData")
assert(!isCached("testData"), "Table 'testData' should not be cached")
- assert(!isMaterialized(rddId), "Uncached in-memory table should have been unpersisted")
+
+ eventually(timeout(10 seconds)) {
+ assert(!isMaterialized(rddId), "Uncached in-memory table should have been unpersisted")
+ }
}
test("CACHE TABLE tableName AS SELECT * FROM anotherTable") {
@@ -204,7 +213,9 @@ class CachedTableSuite extends QueryTest {
"Eagerly cached in-memory table should have already been materialized")
uncacheTable("testCacheTable")
- assert(!isMaterialized(rddId), "Uncached in-memory table should have been unpersisted")
+ eventually(timeout(10 seconds)) {
+ assert(!isMaterialized(rddId), "Uncached in-memory table should have been unpersisted")
+ }
}
test("CACHE TABLE tableName AS SELECT ...") {
@@ -217,7 +228,9 @@ class CachedTableSuite extends QueryTest {
"Eagerly cached in-memory table should have already been materialized")
uncacheTable("testCacheTable")
- assert(!isMaterialized(rddId), "Uncached in-memory table should have been unpersisted")
+ eventually(timeout(10 seconds)) {
+ assert(!isMaterialized(rddId), "Uncached in-memory table should have been unpersisted")
+ }
}
test("CACHE LAZY TABLE tableName") {
@@ -235,7 +248,9 @@ class CachedTableSuite extends QueryTest {
"Lazily cached in-memory table should have been materialized")
uncacheTable("testData")
- assert(!isMaterialized(rddId), "Uncached in-memory table should have been unpersisted")
+ eventually(timeout(10 seconds)) {
+ assert(!isMaterialized(rddId), "Uncached in-memory table should have been unpersisted")
+ }
}
test("InMemoryRelation statistics") {