You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Bill Burcham (Jira)" <ji...@apache.org> on 2021/05/19 01:14:00 UTC

[jira] [Created] (GEODE-9288) DeployedJarTest fails because JavaCompiler.compile() fails to delete temporaryClassesDirectory

Bill Burcham created GEODE-9288:
-----------------------------------

             Summary: DeployedJarTest fails because JavaCompiler.compile() fails to delete temporaryClassesDirectory
                 Key: GEODE-9288
                 URL: https://issues.apache.org/jira/browse/GEODE-9288
             Project: Geode
          Issue Type: Bug
          Components: tests
    Affects Versions: 1.15.0
            Reporter: Bill Burcham


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

{code:java}
org.apache.geode.deployment.internal.DeployedJarTest > throwsIfFileIsNotValidJarFile FAILED
    java.io.IOException: Unable to delete directory C:\Users\geode\AppData\Local\Temp\1621373797371-0\classes.
        at org.apache.commons.io.FileUtils.deleteDirectory(FileUtils.java:1212)
        at org.apache.geode.test.compiler.JavaCompiler.compile(JavaCompiler.java:90)
        at org.apache.geode.test.compiler.JarBuilder.buildJarFromClassNames(JarBuilder.java:79)
        at org.apache.geode.deployment.internal.DeployedJarTest.createJarFile(DeployedJarTest.java:82)
        at org.apache.geode.deployment.internal.DeployedJarTest.throwsIfFileIsNotValidJarFile(DeployedJarTest.java:47)
{code}




--
This message was sent by Atlassian Jira
(v8.3.4#803005)