Skip to content

Commit

Permalink
fix flaky test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangxb1987 committed Jun 15, 2017
1 parent 1bf55e3 commit 7515a5b
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

package org.apache.spark.rdd

import scala.concurrent.duration._

import org.scalatest.concurrent.Eventually.{eventually, interval, timeout}

import org.apache.spark.{LocalSparkContext, SparkContext, SparkException, SparkFunSuite}
import org.apache.spark.storage.{RDDBlockId, StorageLevel}

Expand Down Expand Up @@ -168,6 +172,10 @@ class LocalCheckpointSuite extends SparkFunSuite with LocalSparkContext {
// Collecting the RDD should now fail with an informative exception
val blockId = RDDBlockId(rdd.id, numPartitions - 1)
bmm.removeBlock(blockId)
// Wait until the block has been removed successfully.
eventually(timeout(1 seconds), interval(100 milliseconds)) {
assert(bmm.getBlockStatus(blockId).size == 0)
}
try {
rdd.collect()
fail("Collect should have failed if local checkpoint block is removed...")
Expand Down

0 comments on commit 7515a5b

Please sign in to comment.