diff options
author | Mark Hamstra <markhamstra@gmail.com> | 2014-06-18 14:56:41 -0700 |
---|---|---|
committer | Tathagata Das <tathagata.das1565@gmail.com> | 2014-06-18 14:56:41 -0700 |
commit | 4cbeea83e086bbbb1898bf796a5e5b789bc4cc06 (patch) | |
tree | 7349c20132bc07b19832b0493082ce66069095d5 /core/src/test | |
parent | 3870248740d83b0292ccca88a494ce19783847f0 (diff) | |
download | spark-4cbeea83e086bbbb1898bf796a5e5b789bc4cc06.tar.gz spark-4cbeea83e086bbbb1898bf796a5e5b789bc4cc06.tar.bz2 spark-4cbeea83e086bbbb1898bf796a5e5b789bc4cc06.zip |
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
Diffstat (limited to 'core/src/test')
-rw-r--r-- | core/src/test/scala/org/apache/spark/util/FileAppenderSuite.scala | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/core/src/test/scala/org/apache/spark/util/FileAppenderSuite.scala b/core/src/test/scala/org/apache/spark/util/FileAppenderSuite.scala index 53d7f5c607..02e228945b 100644 --- a/core/src/test/scala/org/apache/spark/util/FileAppenderSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/FileAppenderSuite.scala @@ -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._ |