由于阶段失败,火花单元测试失败

时间:2016-10-07 07:46:22

标签: scala apache-spark sbt scalatest

我最近将一个应用程序从Spark 1.4.1升级到1.6.0,其中我的应用程序中的单元测试(在ScalaTest 3.0中)突然失败,这不是由于API中的API或行为更改。

奇怪的是,每次我使用sbt test运行测试时,不同的测试都会失败并始终显示以下消息:

[info]   org.apache.spark.SparkException: Job aborted due to stage failure: Task 87 in stage 206.0 failed 1 times, most recent failure: Lost task 87.0 in stage 206.0 (TID 4228, localhost): ExecutorLostFailure (executor driver exited caused by one of the running
 tasks) Reason: Executor heartbeat timed out after 148400 ms
[info] Driver stacktrace:
[info]   at org.apache.spark.scheduler.DAGScheduler.org$apache$spark$scheduler$DAGScheduler$$failJobAndIndependentStages(DAGScheduler.scala:1431)
[info]   at org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1419)
[info]   at org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1418)
[info]   at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
[info]   at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
[info]   at org.apache.spark.scheduler.DAGScheduler.abortStage(DAGScheduler.scala:1418)
[info]   at org.apache.spark.scheduler.DAGScheduler$$anonfun$handleTaskSetFailed$1.apply(DAGScheduler.scala:799)
[info]   at org.apache.spark.scheduler.DAGScheduler$$anonfun$handleTaskSetFailed$1.apply(DAGScheduler.scala:799)
[info]   at scala.Option.foreach(Option.scala:236)
[info]   at org.apache.spark.scheduler.DAGScheduler.handleTaskSetFailed(DAGScheduler.scala:799)
[info]   ...

我在build.sbt中设置了以下内容:

javaOptions in test += "-Xmx2G"
fork in test := true
parallelExecution in test := false

所以,单元测试很好,但有些事情发生了,我无法指责。有没有人有想法?

1 个答案:

答案 0 :(得分:1)

由于此代码一直有效,我怀疑默认内存设置(执行程序或驱动程序或开销)可能随升级而改变。

请为您的应用程序ID发布纱线日志。它将有更多的错误细节。

此外,请参阅此链接以查找类似错误https://community.cloudera.com/t5/Advanced-Analytics-Apache-Spark/Executor-Timed-Out/td-p/45097