提交 a4d43051 编写于 作者: J Jesse Glick

Clean up TestPluginManager.INSTANCE.rootDir at the end of the test run.

Otherwise your disk will fill up with (large) /tmp/hudson*tmp/ dirs when running plugin tests.
(Would have been better to use e.g. TemporaryFolder, but that would require incompatible changes to the test harness.)
上级 e837438c
......@@ -124,6 +124,15 @@ public class TestPluginManager extends PluginManager {
static {
try {
INSTANCE = new TestPluginManager();
Runtime.getRuntime().addShutdownHook(new Thread("delete " + INSTANCE.rootDir) {
@Override public void run() {
try {
Util.deleteRecursive(INSTANCE.rootDir);
} catch (IOException x) {
x.printStackTrace();
}
}
});
} catch (IOException e) {
throw new Error(e);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册