Skip to content
Snippets Groups Projects
Commit 4cbeea83 authored by Mark Hamstra's avatar Mark Hamstra Committed by Tathagata Das
Browse files

SPARK-2158 Clean up core/stdout file from FileAppenderSuite

@tdas

Author: Mark Hamstra <markhamstra@gmail.com>

Closes #1100 from markhamstra/SPARK-2158 and squashes the following commits:

ae8e069 [Mark Hamstra] Response to TD's review
2f1e201 [Mark Hamstra] Cleanup 'stdout' file within FileAppenderSuite
parent 38702487
No related branches found
No related tags found
No related merge requests found
......@@ -120,7 +120,7 @@ class FileAppenderSuite extends FunSuite with BeforeAndAfter with Logging {
// on SparkConf settings.
def testAppenderSelection[ExpectedAppender: ClassTag, ExpectedRollingPolicy](
properties: Seq[(String, String)], expectedRollingPolicyParam: Long = -1): FileAppender = {
properties: Seq[(String, String)], expectedRollingPolicyParam: Long = -1): Unit = {
// Set spark conf properties
val conf = new SparkConf
......@@ -129,8 +129,9 @@ class FileAppenderSuite extends FunSuite with BeforeAndAfter with Logging {
}
// Create and test file appender
val inputStream = new PipedInputStream(new PipedOutputStream())
val appender = FileAppender(inputStream, new File("stdout"), conf)
val testOutputStream = new PipedOutputStream()
val testInputStream = new PipedInputStream(testOutputStream)
val appender = FileAppender(testInputStream, testFile, conf)
assert(appender.isInstanceOf[ExpectedAppender])
assert(appender.getClass.getSimpleName ===
classTag[ExpectedAppender].runtimeClass.getSimpleName)
......@@ -144,7 +145,8 @@ class FileAppenderSuite extends FunSuite with BeforeAndAfter with Logging {
}
assert(policyParam === expectedRollingPolicyParam)
}
appender
testOutputStream.close()
appender.awaitTermination()
}
import RollingFileAppender._
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment