Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-4409

Hudson test case leaks temp folders

    Details

    • Similar Issues:

      Description

      I have noticed that the HudsonTestCase sometimes does not do a proper clean up
      of the temp folders. On Windows this happens every time because of a file in use
      error. On Linux (debian) this sometimes happen if a test fails. As the temp
      folder can contain up to 14mbs, the total size can grow quickly.

      After 1 month of developing/testing my hudson test case folders consisted of
      500+k files in 892 folders, amounting to 7+Gb. (Windows)

      Maybe we can use the new TemporaryFolder rule that is available in JUnit 4.7, so
      we can lift out stuff from our implementation? http://github.com/KentBeck/junit/raw/23ffc6baf5768057e366e183e53f4dfa86fbb005/do
      c/ReleaseNotes4.7.txt

      Steps to reproduce on linux:
      1. Clean out all hudsonXXXX folders in the temp folder
      2. Go to hudson/plugins/seleniuma
      3. run "mvn test" and watch it fail
      4. Check the temp folder

      Expected result:
      No new folder in the temp folder

      Actual Result:
      A folder named hudsonXXXXXXX has been created

      Steps to reproduce:
      1. Go to hudson/plugins/ci-game
      2. run "mvn test"
      3. Watch output

      Expected result:
      Test fails

      Actual Result:
      An exception is thrown during the test clean up:

      java.io.IOException: Unable to delete
      C:\DOCUME~1\name\LOCALS~1\Temp\hudson40664test\plugins\maven-plugin\WEB-INF\lib\
      classworlds-1.1.jar
      at hudson.Util.deleteFile(Util.java:225)
      at hudson.Util.deleteRecursive(Util.java:257)
      at hudson.Util.deleteContentsRecursive(Util.java:186)
      at hudson.Util.deleteRecursive(Util.java:256)
      at hudson.Util.deleteContentsRecursive(Util.java:186)
      at hudson.Util.deleteRecursive(Util.java:256)
      at hudson.Util.deleteContentsRecursive(Util.java:186)
      at hudson.Util.deleteRecursive(Util.java:256)
      at hudson.Util.deleteContentsRecursive(Util.java:186)
      at hudson.Util.deleteRecursive(Util.java:256)
      at hudson.Util.deleteContentsRecursive(Util.java:186)
      at hudson.Util.deleteRecursive(Util.java:256)
      at hudson.FilePath$9.invoke(FilePath.java:748)
      at hudson.FilePath$9.invoke(FilePath.java:746)
      at hudson.FilePath.act(FilePath.java:676)
      at hudson.FilePath.act(FilePath.java:660)
      at hudson.FilePath.deleteRecursive(FilePath.java:746)
      at
      org.jvnet.hudson.test.TemporaryDirectoryAllocator$1.run(TemporaryDirectoryAlloca
      tor.java:90)

        Attachments

          Issue Links

            Activity

            redsolo redsolo created issue -
            abayer Andrew Bayer made changes -
            Field Original Value New Value
            Link This issue is duplicated by JENKINS-4249 [ JENKINS-4249 ]
            swestcott Simon Westcott made changes -
            Link This issue is related to JENKINS-12328 [ JENKINS-12328 ]
            ikedam ikedam made changes -
            Link This issue is related to JENKINS-18643 [ JENKINS-18643 ]
            jglick Jesse Glick made changes -
            Labels testing windows
            jglick Jesse Glick made changes -
            Assignee ikedam [ ikedam ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Remote Link This issue links to "PR 1572 (Web Link)" [ 12124 ]
            jglick Jesse Glick made changes -
            Labels testing windows lts-candidate testing windows
            scm_issue_link SCM/JIRA link daemon made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            olivergondza Oliver Gondža made changes -
            Labels lts-candidate testing windows 1.596.2-fixed testing windows
            olivergondza Oliver Gondža made changes -
            Labels 1.596.2-fixed testing windows 1.596.3-fixed testing windows
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 134482 ] JNJira + In-Review [ 186817 ]

              People

              • Assignee:
                ikedam ikedam
                Reporter:
                redsolo redsolo
              • Votes:
                4 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: