Permalink
Browse files

Added a test for the previous commit (failing to serialize task results

would throw an exception for local tasks).
  • Loading branch information...
1 parent 9821cd4 commit 761ea65a98f448f158e17d7c03d1566fc06fb265 @rxin rxin committed Apr 24, 2012
Showing with 16 additions and 0 deletions.
  1. +16 −0 core/src/test/scala/spark/FailureSuite.scala
@@ -65,5 +65,21 @@ class FailureSuite extends FunSuite {
FailureSuiteState.clear()
}
+ test("failure because task results are not serializable") {
+ val sc = new SparkContext("local[1,1]", "test")
+ val results = sc.makeRDD(1 to 3).map(x => new NonSerializable)
+
+ val thrown = intercept[spark.SparkException] {
+ results.collect()
+ }
+ assert(thrown.getClass === classOf[spark.SparkException])
+ assert(thrown.getMessage.contains("NotSerializableException"))
+
+ sc.stop()
+ FailureSuiteState.clear()
+ }
+
// TODO: Need to add tests with shuffle fetch failures.
}
+
+

0 comments on commit 761ea65

Please sign in to comment.