Skip to content

Commit

Permalink
[SPARK-21516][SQL][TEST] Overriding afterEach() in DatasetCacheSuite …
Browse files Browse the repository at this point in the history
…must call super.afterEach()

## What changes were proposed in this pull request?

This PR ensures to call `super.afterEach()` in overriding `afterEach()` method in `DatasetCacheSuite`. When we override `afterEach()` method in Testsuite, we have to call `super.afterEach()`.

This is a follow-up of #18719 and SPARK-21512.

## How was this patch tested?

Used the existing test suite

Author: Kazuaki Ishizaki <ishizaki@jp.ibm.com>

Closes #18721 from kiszk/SPARK-21516.
  • Loading branch information
kiszk authored and cloud-fan committed Jul 25, 2017
1 parent b09ec92 commit 7f29505
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Expand Up @@ -25,11 +25,6 @@ import org.apache.spark.storage.StorageLevel
class DatasetCacheSuite extends QueryTest with SharedSQLContext {
import testImplicits._

// Clear all persistent datasets after each test
override def afterEach(): Unit = {
spark.sharedState.cacheManager.clearCache()
}

test("get storage level") {
val ds1 = Seq("1", "2").toDS().as("a")
val ds2 = Seq(2, 3).toDS().as("b")
Expand Down
Expand Up @@ -87,6 +87,8 @@ trait SharedSQLContext extends SQLTestUtils with BeforeAndAfterEach with Eventua

protected override def afterEach(): Unit = {
super.afterEach()
// Clear all persistent datasets after each test
spark.sharedState.cacheManager.clearCache()
// files can be closed from other threads, so wait a bit
// normally this doesn't take more than 1s
eventually(timeout(10.seconds)) {
Expand Down

0 comments on commit 7f29505

Please sign in to comment.