Skip to content

Commit 9df0276

Browse files
committed
Added check to make sure that streamed-to-dist RDD actually returns good data in the LargeIteratorSuite
1 parent a6424ba commit 9df0276

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/src/test/scala/org/apache/spark/storage/LargeIteratorSuite.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ class LargeIteratorSuite extends FunSuite with LocalSparkContext {
5151
"This is the second sentence that we will test:",
5252
"This is the third sentence that we will test:"
5353
) );
54-
val out = seeds.flatMap(Expander.expand(_,10000000));
55-
out.map(_ + "...").persist(StorageLevel.DISK_ONLY).saveAsTextFile("./test.out")
54+
val expand_size = 10000000;
55+
val out = seeds.flatMap(Expander.expand(_,expand_size));
56+
val expanded = out.map(_ + "...").persist(StorageLevel.DISK_ONLY)
57+
assert( expanded.filter( _.startsWith("This is the first sentence that we will test")).count() == expand_size )
58+
expanded.saveAsTextFile("./test.out")
5659
FileUtils.deleteDirectory(new File("./test.out"))
5760
}
5861
}

0 commit comments

Comments
 (0)