attilapiros commented on a change in pull request #34651:
URL: https://github.com/apache/spark/pull/34651#discussion_r767131477
##########
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 `unittest.log`. So in case of the example
used in the PR description where one of the test from `DistributedSuite` failed
(because I have added a temporary `assert(false)`) the
`core/target/unittest.log` was extended by the worker logs.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]