Skip to content
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

[FIXED JENKINS-4409] Use a fixed directory for TestPluginManager. #780

Closed
wants to merge 1 commit into from

Conversation

ikedam
Copy link
Member

@ikedam ikedam commented May 19, 2013

TestPluginManager expands plugins to a temporary directory at the start of all tests. This temporary directory is deleted with a shutdown hook of JVM.

In Windows, for JVM holds the handle of jar files bundled with plugins, it always fails to delete the temporary directory where plugins expanded. That is, ${java.io.tmpdir}/hudson*tmp is left even after the test finishes. Every time a test runs, the size of the temporary directory grows up.

TestPluginManager seems not need to use a different directory every time. Using a fixed directory prevents the size of the temporary directory growing up.

JENKINS-4409

@cloudbees-pull-request-builder

core » jenkins_main_trunk #877 UNSTABLE
Looks like there's a problem with this pull request

@ikedam
Copy link
Member Author

ikedam commented May 19, 2013

@cloudbees-pull-request-builder Hmm... A failure caused by this change?
I'll verify it in my environment...

@ikedam
Copy link
Member Author

ikedam commented May 19, 2013

No. The failure seems caused for http://updates.jenkins-ci.org/ is out of service.
I'll trigger the test again in another day...

@ikedam
Copy link
Member Author

ikedam commented May 20, 2013

Hmm...I seem not allowed to trigger a build...
I believe this failure is not for this commit.

@@ -123,7 +128,14 @@ public void stop() {

static {
try {
INSTANCE = new TestPluginManager();
File rootDir = new File("./target/plugin-manager-for-test").getAbsoluteFile();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No good, this will behave differently depending on the CWD in effect when the test is run, which could be anything.

@jglick
Copy link
Member

jglick commented May 22, 2013

Using a fixed directory seems dangerous—it means that different parallel test runs could clobber one another, or tests might pick up obsolete plugin versions from an older test run, etc.

I would rather try to diagnose and fix the failure to delete the JAR files. Typically this just means that someone is forgetting to close a JarFile, which can be solved by calling PluginWrapper.releaseClassLoader.

@ikedam
Copy link
Member Author

ikedam commented May 22, 2013

@jglick OK. I'll try that. Thanks!

@ikedam ikedam closed this May 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants