panbingkun commented on code in PR #43921:
URL: https://github.com/apache/spark/pull/43921#discussion_r1400168939


##########
sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ui/HiveThriftServer2ListenerSuite.scala:
##########
@@ -34,6 +35,15 @@ class HiveThriftServer2ListenerSuite extends SparkFunSuite 
with BeforeAndAfter {
 
   private var kvstore: ElementTrackingStore = _
 
+  protected override def beforeAll(): Unit = {
+    val tmpDirName = System.getProperty("java.io.tmpdir")
+    val tmpDir = new File(tmpDirName)
+    if (!tmpDir.exists()) {
+      tmpDir.mkdirs()

Review Comment:
   1.When I ran another UT:
   ```
   build/sbt clean "hive-thriftserver/testOnly 
org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperationSuite" 
-Phive-thriftserver
   ```
   I found that the tmp directory it automatically created was not deleted 
either.
   
   2.Additionally, when UT(`HiveThriftServer2ListenerSuite` and 
`ThriftServerPageSuite`) is completed, the automatically generated tmp 
directory is actually empty.
   <img width="1417" alt="image" 
src="https://github.com/apache/spark/assets/15246973/fd961dc6-a5cf-4bf4-b0c4-2df3aa788c88";>
   
   3.If we need to `clean up` it after test, perhaps we need a method similar 
to this:
   
https://github.com/apache/spark/blob/c476641812cc1be6aa6e4f573501cdef2dc9ef89/core/src/main/scala/org/apache/spark/util/Utils.scala#L242-L248
   



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