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

Hudson test case leaks temp folders

    XMLWordPrintable

    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

            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            test/src/main/java/org/jvnet/hudson/test/TestPluginManager.java
            http://jenkins-ci.org/commit/jenkins-test-harness/bfb70904a4c3cbeb90f1e55766ea2456695b73ea
            Log:
            [FIX JENKINS-4409] Release plugins and class loaders when JVM shuts down.

            Originally-Committed-As: 2b9a083fbf2b9f4946ffa01e35dffea2b20a98d1

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: test/src/main/java/org/jvnet/hudson/test/TestPluginManager.java http://jenkins-ci.org/commit/jenkins-test-harness/bfb70904a4c3cbeb90f1e55766ea2456695b73ea Log: [FIX JENKINS-4409] Release plugins and class loaders when JVM shuts down. Originally-Committed-As: 2b9a083fbf2b9f4946ffa01e35dffea2b20a98d1
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java
            test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java
            http://jenkins-ci.org/commit/jenkins-test-harness/cb5bb384b1b995c08bdb2843d9a1ad2b1166066b
            Log:
            [FIXED JENKINS-4409] Disable URLConnection.useCache in tests on Windows. It prevents deleting temporary directories when tests finish.

            Originally-Committed-As: c4e5fbdbc9c644f1afcae031b3b4638ad5297238

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java http://jenkins-ci.org/commit/jenkins-test-harness/cb5bb384b1b995c08bdb2843d9a1ad2b1166066b Log: [FIXED JENKINS-4409] Disable URLConnection.useCache in tests on Windows. It prevents deleting temporary directories when tests finish. Originally-Committed-As: c4e5fbdbc9c644f1afcae031b3b4638ad5297238
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java
            test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java
            http://jenkins-ci.org/commit/jenkins-test-harness/bd3655c132a175255598d6c13cd7d8b231e5c1a3
            Log:
            Merge pull request #1572 from ikedam/feature/JENKINS-4409_DisableURLConnectionCache

            JENKINS-4409 Disable URLConnection.useCache in tests on Windows
            Originally-Committed-As: c8abbfc9728aa7a1bff415e6f4e624209ceb0020

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java http://jenkins-ci.org/commit/jenkins-test-harness/bd3655c132a175255598d6c13cd7d8b231e5c1a3 Log: Merge pull request #1572 from ikedam/feature/ JENKINS-4409 _DisableURLConnectionCache JENKINS-4409 Disable URLConnection.useCache in tests on Windows Originally-Committed-As: c8abbfc9728aa7a1bff415e6f4e624209ceb0020
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: ikedam
            Path:
            test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java
            test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java
            http://jenkins-ci.org/commit/jenkins-test-harness/3b839f41c16d0c5bc7d96a238c7beaac87885f96
            Log:
            [FIXED JENKINS-4409] Disable URLConnection.useCache in tests on Windows. It prevents deleting temporary directories when tests finish.

            (cherry picked from commit c4e5fbdbc9c644f1afcae031b3b4638ad5297238)

            Originally-Committed-As: 9bce20951c3ffe8e83a18a5a8d5743e183ebf3a8

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java http://jenkins-ci.org/commit/jenkins-test-harness/3b839f41c16d0c5bc7d96a238c7beaac87885f96 Log: [FIXED JENKINS-4409] Disable URLConnection.useCache in tests on Windows. It prevents deleting temporary directories when tests finish. (cherry picked from commit c4e5fbdbc9c644f1afcae031b3b4638ad5297238) Originally-Committed-As: 9bce20951c3ffe8e83a18a5a8d5743e183ebf3a8
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Christian Pönisch
            Path:
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/SystemTestBase.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/TestPluginManagerCleanUp.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/atx/ATXPublisherST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/atx/ATXPublisherTest.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/generator/ReportGeneratorPublisherST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/generator/ReportGeneratorPublisherTest.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/junit/JUnitPublisherST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/junit/JUnitPublisherTest.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/log/ETLogPublisherST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/log/ETLogPublisherTest.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/trf/TRFPublisherST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/trf/TRFPublisherTest.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestFolderBuilderST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestFolderBuilderTest.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestPackageBuilderST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestPackageBuilderTest.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestProjectBuilderST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestProjectBuilderTest.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartETBuilderST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartETBuilderTest.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartTSBuilderST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartTSBuilderTest.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopETBuilderST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopETBuilderTest.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopTSBuilderST.java
            src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopTSBuilderTest.java
            http://jenkins-ci.org/commit/ecutest-plugin/189cbd8a033bb7fb204ff7a68ad38cd0e5e90bf1
            Log:
            JENKINS-31999 added more tests

            • avoid JENKINS-4409 in system tests
            • removed unnecessary TestPluginManagerCleanUp
            • added more unit tests
            • added more system tests validating pipeline steps
            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christian Pönisch Path: src/test/java/de/tracetronic/jenkins/plugins/ecutest/SystemTestBase.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/TestPluginManagerCleanUp.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/atx/ATXPublisherST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/atx/ATXPublisherTest.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/generator/ReportGeneratorPublisherST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/generator/ReportGeneratorPublisherTest.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/junit/JUnitPublisherST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/junit/JUnitPublisherTest.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/log/ETLogPublisherST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/log/ETLogPublisherTest.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/trf/TRFPublisherST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/report/trf/TRFPublisherTest.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestFolderBuilderST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestFolderBuilderTest.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestPackageBuilderST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestPackageBuilderTest.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestProjectBuilderST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/test/TestProjectBuilderTest.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartETBuilderST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartETBuilderTest.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartTSBuilderST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StartTSBuilderTest.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopETBuilderST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopETBuilderTest.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopTSBuilderST.java src/test/java/de/tracetronic/jenkins/plugins/ecutest/tool/StopTSBuilderTest.java http://jenkins-ci.org/commit/ecutest-plugin/189cbd8a033bb7fb204ff7a68ad38cd0e5e90bf1 Log: JENKINS-31999 added more tests avoid JENKINS-4409 in system tests removed unnecessary TestPluginManagerCleanUp added more unit tests added more system tests validating pipeline steps

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: