Disable H2 cache, project and plugin polling during acceptance tests

Removing the local disk cache saves time during the acceptance test as
local disk cache is a write-through cache system that is somewhat
slower during writes.  The H2 database is also leaking daemon threads
between tests that are not being correctly cleaned up, simply avoiding
using the H2 database in this context works around this leak.

Currently no test depend on the project or plugin background check
features.  Both are implemented by starting a new thread that never
terminates, consuming CPU and memory from additional tests run in the
same JVM.  Disable both of these features.

Change-Id: Id1e592d02b429d3d555fc006be8cd9d9c691a6b3
This commit is contained in:
Shawn Pearce 2013-07-29 22:19:21 -07:00 committed by Dave Borowitz
parent 2d60ff0024
commit d46c321e32

View File

@ -23,6 +23,7 @@ import com.google.inject.Injector;
import com.google.inject.Module;
import org.eclipse.jgit.errors.ConfigInvalidException;
import org.eclipse.jgit.lib.RepositoryCache;
import org.eclipse.jgit.storage.file.FileBasedConfig;
import org.eclipse.jgit.util.FS;
@ -98,6 +99,9 @@ class GerritServer {
cfg.setString("gerrit", null, "canonicalWebUrl", url);
cfg.setString("httpd", null, "listenUrl", url);
cfg.setString("sshd", null, "listenAddress", format(sshd));
cfg.setString("cache", null, "directory", null);
cfg.setInt("cache", "projects", "checkFrequency", 0);
cfg.setInt("plugins", null, "checkFrequency", 0);
cfg.save();
return tmp;
}
@ -198,5 +202,6 @@ class GerritServer {
daemonService.shutdownNow();
daemonService.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS);
TempFileUtil.recursivelyDelete(sitePath);
RepositoryCache.clear();
}
}