aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/scala
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/test/scala')
-rw-r--r--core/src/test/scala/org/apache/spark/DistributedSuite.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/src/test/scala/org/apache/spark/DistributedSuite.scala b/core/src/test/scala/org/apache/spark/DistributedSuite.scala
index 0515e6e3a6..6beae842b0 100644
--- a/core/src/test/scala/org/apache/spark/DistributedSuite.scala
+++ b/core/src/test/scala/org/apache/spark/DistributedSuite.scala
@@ -134,6 +134,21 @@ class DistributedSuite extends SparkFunSuite with Matchers with LocalSparkContex
}
}
+ test("repeatedly failing task that crashes JVM with a zero exit code (SPARK-16925)") {
+ // Ensures that if a task which causes the JVM to exit with a zero exit code will cause the
+ // Spark job to eventually fail.
+ sc = new SparkContext(clusterUrl, "test")
+ failAfter(Span(100000, Millis)) {
+ val thrown = intercept[SparkException] {
+ sc.parallelize(1 to 1, 1).foreachPartition { _ => System.exit(0) }
+ }
+ assert(thrown.getClass === classOf[SparkException])
+ assert(thrown.getMessage.contains("failed 4 times"))
+ }
+ // Check that the cluster is still usable:
+ sc.parallelize(1 to 10).count()
+ }
+
test("caching") {
sc = new SparkContext(clusterUrl, "test")
val data = sc.parallelize(1 to 1000, 10).cache()