mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 21:42:27 +00:00
boy we weren't cleaning up the garbage in /tmp!
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@29419 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
9953660742
commit
69b219e36e
2 files changed
+11
-2
No files matched your search
@@ -76,9 +76,15 @@ public class TemporaryDirectoryAllocator {
|
||||
* Deletes all allocated temporary directories.
|
||||
*/
|
||||
public synchronized void dispose() throws IOException, InterruptedException {
|
||||
IOException x = null;
|
||||
for (File dir : tmpDirectories)
|
||||
new FilePath(dir).deleteRecursive();
|
||||
try {
|
||||
new FilePath(dir).deleteRecursive();
|
||||
} catch (IOException e) {
|
||||
x = e;
|
||||
}
|
||||
tmpDirectories.clear();
|
||||
if (x!=null) throw new IOException2("Failed to clean up temp dirs",x);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,6 +26,8 @@ package org.jvnet.hudson.test;
|
||||
import hudson.model.Computer;
|
||||
import hudson.model.Hudson;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* TODO: deprecate this, and just consolidate this to {@link HudsonTestCase}.
|
||||
* We can then pin down the current HudsonTestCase to the thread for easier access.
|
||||
@@ -48,7 +50,8 @@ public class TestEnvironment {
|
||||
CURRENT = this;
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
public void dispose() throws IOException, InterruptedException {
|
||||
temporaryDirectoryAllocator.dispose();
|
||||
CURRENT = null;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user