You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/12/10 14:24:06 UTC
[GitHub] [spark] Ngone51 commented on a change in pull request #34651: [SPARK-37373] Collecting LocalSparkContext worker logs in case of test failure
Ngone51 commented on a change in pull request #34651:
URL: https://github.com/apache/spark/pull/34651#discussion_r766717269
##########
File path: core/src/test/scala/org/apache/spark/SparkFunSuite.scala
##########
@@ -172,7 +173,18 @@ abstract class SparkFunSuite
}
}
- protected def logForFailedTest(): Unit = {}
+ protected def logForFailedTest(): Unit = {
+ LocalSparkCluster.get.foreach { localCluster =>
+ val workerLogfiles = localCluster.workerLogfiles
+ if (workerLogfiles.nonEmpty) {
+ logInfo("\n\n===== EXTRA LOGS FOR THE FAILED TEST\n")
+ workerLogfiles.foreach { logFile =>
+ logInfo(s"\n----- Logfile: ${logFile.getAbsolutePath()}")
+ logInfo(FileUtils.readFileToString(logFile, "UTF-8"))
Review comment:
This will be appended to the driver log or somewhere else?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org