Skip to content

Commit ae8e069

Browse files
committed
Response to TD's review
1 parent 2f1e201 commit ae8e069

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

core/src/test/scala/org/apache/spark/util/FileAppenderSuite.scala

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ class FileAppenderSuite extends FunSuite with BeforeAndAfter with Logging {
129129
}
130130

131131
// Create and test file appender
132-
val inputStream = new PipedInputStream(new PipedOutputStream())
133-
val outFile = new File("stdout")
134-
val appender = FileAppender(inputStream, outFile, conf)
132+
val testOutputStream = new PipedOutputStream()
133+
val testInputStream = new PipedInputStream(testOutputStream)
134+
val appender = FileAppender(testInputStream, testFile, conf)
135135
assert(appender.isInstanceOf[ExpectedAppender])
136136
assert(appender.getClass.getSimpleName ===
137137
classTag[ExpectedAppender].runtimeClass.getSimpleName)
@@ -145,9 +145,8 @@ class FileAppenderSuite extends FunSuite with BeforeAndAfter with Logging {
145145
}
146146
assert(policyParam === expectedRollingPolicyParam)
147147
}
148-
appender.stop()
149-
appender.awaitTermination
150-
assert(outFile.delete())
148+
testOutputStream.close()
149+
appender.awaitTermination()
151150
}
152151

153152
import RollingFileAppender._

0 commit comments

Comments
 (0)