Skip to content
Snippets Groups Projects
Commit 206f9bc3 authored by Reynold Xin's avatar Reynold Xin
Browse files

[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.
parent 6b4c7f08
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,12 @@ ...@@ -17,6 +17,12 @@
package org.apache.spark.sql 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.TestData._
import org.apache.spark.sql.columnar._ import org.apache.spark.sql.columnar._
import org.apache.spark.sql.Dsl._ import org.apache.spark.sql.Dsl._
...@@ -191,7 +197,10 @@ class CachedTableSuite extends QueryTest { ...@@ -191,7 +197,10 @@ class CachedTableSuite extends QueryTest {
sql("UNCACHE TABLE testData") sql("UNCACHE TABLE testData")
assert(!isCached("testData"), "Table 'testData' should not be cached") 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") { test("CACHE TABLE tableName AS SELECT * FROM anotherTable") {
...@@ -204,7 +213,9 @@ class CachedTableSuite extends QueryTest { ...@@ -204,7 +213,9 @@ class CachedTableSuite extends QueryTest {
"Eagerly cached in-memory table should have already been materialized") "Eagerly cached in-memory table should have already been materialized")
uncacheTable("testCacheTable") 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 ...") { test("CACHE TABLE tableName AS SELECT ...") {
...@@ -217,7 +228,9 @@ class CachedTableSuite extends QueryTest { ...@@ -217,7 +228,9 @@ class CachedTableSuite extends QueryTest {
"Eagerly cached in-memory table should have already been materialized") "Eagerly cached in-memory table should have already been materialized")
uncacheTable("testCacheTable") 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") { test("CACHE LAZY TABLE tableName") {
...@@ -235,7 +248,9 @@ class CachedTableSuite extends QueryTest { ...@@ -235,7 +248,9 @@ class CachedTableSuite extends QueryTest {
"Lazily cached in-memory table should have been materialized") "Lazily cached in-memory table should have been materialized")
uncacheTable("testData") 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") { test("InMemoryRelation statistics") {
......
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