Jiabao-Sun commented on code in PR #23917:
URL: https://github.com/apache/flink/pull/23917#discussion_r1427932231


##########
flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/runtime/utils/StreamingWithStateTestBase.scala:
##########
@@ -68,8 +69,8 @@ class StreamingWithStateTestBase(state: StateBackendMode) 
extends StreamingTestB
     super.before()
     // set state backend
 
-    // subfolder are managed here because the tests could fail during cleanup 
when concurrently executed (see FLINK-33820)
-    baseCheckpointPath = TempDirUtils.newFolder(tempFolder)
+    val baseCheckpointPath = 
Files.createTempDirectory(getClass.getCanonicalName)
+    Files.deleteIfExists(baseCheckpointPath);
     state match {

Review Comment:
   Thanks @snuyanzin for this hard work.
   
   But I am a little confused, why is `baseCheckpointPath` defined as a stack 
variable, so does the object variable `baseCheckpointPath: File = _` have no 
effect anymore?
   
   I suspect that there are still some problems about reuse the `tempFolder` by 
`TempDirUtils.newFolder(tempFolder)` instead of directly using 
`Files.createTempDirectory("junit")`.
   I think the cleanup of `tempFolder` may still fail when 
`FileUtils.deleteDirectory(baseCheckpointPath)` met 
`DirectoryNotEmptyException` because it is possible that there are some threads 
still writing to the folder.
   
   



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to