-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop swallowing exceptions that happen in TestEnvironment#dispose()
#166
Stop swallowing exceptions that happen in TestEnvironment#dispose()
#166
Conversation
This commit is excepted to reveal bogus tests that do not properly shutdown, especially on Windows where directory cannot be removed if there are any running processes that use it as a working directory.
4613b63
to
a07387a
Compare
TestEnvironment#dispose()
jenkinsci/git-plugin#798 is a nice case of a bug that was found thanks to this PR + Windows CI. |
This commit fixes file descriptor leak that is detected by jenkinsci/jenkins-test-harness#166
File descriptor leak in subversion plugin: jenkinsci/subversion-plugin#240 |
Attempt to upgrade workflow-cps-plugin to JTH with current fix discovered a bug in JTH itself: jenkinsci/workflow-cps-plugin#345 o_O Similar issue in jenkinsci/lockable-resources-plugin#170 |
This commit fixes test failure with modern JTH detected by jenkinsci/jenkins-test-harness#166
Bug in workflow-support caused by dependency on old workflow-job: jenkinsci/workflow-support-plugin#99. |
Minor leaks in workflow-basic-steps-plugin tests: jenkinsci/workflow-basic-steps-plugin#103 |
I filed PRs to update |
Cool! The only plugin that gives me headaches now is lockable-resources: jenkinsci/lockable-resources-plugin#170. |
Thanks very much for enabling this setting and for fixing the bugs that it discovered in the git plugin. Very much appreciated. I was unwilling to wrestle further with the intermittent GitSCMTest and GitStatusTest build log related failures on ci.jenkins.io from this change. I don't see those failures on the 5 Windows 10 machines that are in my local cluster. Refer to jenkinsci/git-plugin#802 for the workaround which adds a call to Thanks again for this change. A very nice addition! |
WRT locks on build log: I'm not quite sure what's going on there. When working on jenkinsci/workflow-support-plugin#99, I thought there's an issue in workflow-api/workflow-job plugin. But same solution didn't fix jenkinsci/lockable-resources-plugin#170. This needs more investigation. While sleeping for several seconds might allow tests to pass, I feel like this is just a way to hide a bug. My current understanding is that build log should not be accessed by anything after the build has finished. |
This is to stay up-to-date and use the latest features and fixes. The newer jenkins-test-harness provided with this change does not any longer swallow exceptions on test teardown. See jenkinsci/jenkins-test-harness#166 Therefore some tests have been changed to leave the environment in a proper state. Otherwise they would fail under Windows because some Pipeline folders cannot be removed due to open file handles. The `SemaphoreStep` was not used properly and anyway not required in most cases. It has to be used correctly which requires 1-2 lines of code in every test to not leave the environment in a bad state. The platform-independent `echo` step is sufficient and requires no extra code. Using no step at all would maybe also be an option.
The newer jenkins-test-harness provided with this change does not any longer swallow exceptions on test teardown. See jenkinsci/jenkins-test-harness#166 This reveals problems in the implementation and tests. Under Windows tests failed because some folders could not be removed due to open file handles. Fixes: 1) In `BaseFileContent` the `InputStream` was not closed correctly in every case. 2) The `SemaphoreStep` was not used properly and anyway not required in most cases. It has to be used correctly which requires 1-2 lines of code in every test to not leave the environment in a bad state. The platform-independent `echo` step is sufficient and requires no extra code. Using no step at all may also be an option.
The newer jenkins-test-harness provided with this change does not any longer swallow exceptions on test teardown. See jenkinsci/jenkins-test-harness#166 This reveals problems in the implementation and tests. Under Windows tests failed because some folders could not be removed due to open file handles. Fixes: 1) In `BaseFileContent` the `InputStream` was not closed correctly in every case. 2) The `SemaphoreStep` was not used properly and anyway not required in most cases. It has to be used correctly which requires 1-2 lines of code in every test to not leave the environment in a bad state. The platform-independent `echo` step is sufficient and requires no extra code. Using no step at all may also be an option.
The newer jenkins-test-harness provided with this change does not any longer swallow exceptions on test teardown. See jenkinsci/jenkins-test-harness#166 This reveals problems in the implementation and tests. Under Windows tests failed because some folders could not be removed due to open file handles. Fixes: 1) In `BaseFileContent` the `InputStream` was not closed correctly in every case. 2) The `SemaphoreStep` was not used properly and anyway not required in most cases. It has to be used correctly which requires 1-2 lines of code in every test to not leave the environment in a bad state. The platform-independent `echo` step is sufficient and requires no extra code. Using no step at all may also be an option.
This commit fixes test failure with modern JTH detected by jenkinsci/jenkins-test-harness#166
This commit is excepted to reveal bogus tests that do not properly shutdown,
especially on Windows where directory cannot be removed if there are any running processes that use it as a working directory.