HyukjinKwon commented on a change in pull request #33263:
URL: https://github.com/apache/spark/pull/33263#discussion_r670924774



##########
File path: core/src/test/scala/org/apache/spark/util/FileAppenderSuite.scala
##########
@@ -96,6 +105,32 @@ class FileAppenderSuite extends SparkFunSuite with 
BeforeAndAfter with Logging {
       appender, testOutputStream, textToAppend, rolloverIntervalMillis, 
isCompressed = true)
   }
 
+  test("rolling file appender - time-based rolling close stream") {
+    val inputStream = mock(classOf[InputStream])
+    val sparkConf = new SparkConf()
+    sparkConf.set(config.EXECUTOR_LOGS_ROLLING_STRATEGY.key, "time")
+    val appender = FileAppender(inputStream, testFile, sparkConf, closeStreams 
= true)
+    assert(
+      
appender.asInstanceOf[RollingFileAppender].rollingPolicy.isInstanceOf[TimeBasedRollingPolicy])
+    Thread.sleep(10)
+    appender.stop()
+    appender.awaitTermination()
+    verify(inputStream).close()
+  }
+
+  test("rolling file appender - size-based rolling close stream") {

Review comment:
       ditto.




-- 
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]

Reply via email to