alb3rtobr opened a new pull request #6501: URL: https://github.com/apache/geode/pull/6501
…e temp dir Ticket description: > DeployedJarTest.throwsIfFileIsNotValidJarFile() test failed in Windows CI https://concourse.apachegeode-ci.info/teams/main/pipelines/apache-develop-main/jobs/WindowsUnitTestOpenJDK11/builds/225 > > The problem did not reproduce on macOS in 1000 runs. > > I notice that the JavaCompiler constructor calls the deprecated Files.createTempDir(). I wonder if there might be a race condition where two test processes (at once) think they own that temp dir and so they can both delete it. > > We might consider replacing that deprecated call with the recommended Files.createTempDirectory() which may be more robust. Looking at the deprecated method and the recommended substitute the latter might have less of a chance of collision due to its use of random suffixes (versus the former's monotonically-increasing ints). I run the test on ubuntu but the problem did not reproduce either after 1000 runs. I have implemented the change suggested in the ticket to avoid using the deprecated `Files.createTempDir()`. After taking a look a the implementation of the recommended substitute I agree with @Bill : this alternative might have less chances of collision when creating the directory name. -- 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. For queries about this service, please contact Infrastructure at: [email protected]
