Is there any way to easily include assertions in plugin unit test setUp() and tearDown() that no open file leaks have happened during that test?
There are several bug reports against the Git plugin related to files opened which are not closed. Files opened by a process prevent the deletion of that file on Microsoft Windows file systems. I believe the same type of problem is now also affecting the Jenkins core. I executed the Jenkins tests on a Windows machine and several of the tests failed with messages which seemed to indicate the same type of file closing challenges as exist for the Git plugin. I assume those same types of issues exist in other plugins as well. There is a leak detector plugin available from the Update Center which is very helpful on Linux. I've used it to confirm that some of the Git plugin open file leaks are from the JGit implementation, and have also used it to identify open file leaks in the Git plugin source code. The Git plugin has a form of that detection incorporated, but it depends on the test using temporary file allocation and then it detects the failure to cleanup those temporary files on exit. Some of the Git plugin bug reports related to open file leaks are: https://issues.jenkins-ci.org/browse/JENKINS-19994 - cannot delete workspace https://issues.jenkins-ci.org/browse/JENKINS-18843 - pack file busy from JGit (newer) https://issues.jenkins-ci.org/browse/JENKINS-15103 - pack file busy (older bug) https://issues.jenkins-ci.org/browse/JENKINS-20585 - changelog busy I'm sure I can find similar issues in many other plugins and in Jenkins core if I search The best solution I've found thus far has been interactive testing with the leak detector plugin enabled on Linux to detect open file leaks. Thanks, Mark Waite -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
