gerrit/gerrit-acceptance-tests
Dave Borowitz 91d8fe01f9 AbstractDaemonTest: Don't delete common server path too early
Chaining the TemporaryFolder with the custom TestRule results in the
directory for the common server being deleted after the first test
method, even though it might still be needed. This means a @UseLocalDisk
class cannot have more than one method, or things break, including but
not limited to the NRT reopen threads throwing exceptions due to the
index files disappearing out from under them. We just got lucky that
none of our local disk tests were actually affected by this.

To make this work, we can't tie the lifetime of the TemporaryFolder to a
single AbstractDaemonTest method invocation. Instead, create the tempdir
within GerritServer#initAndStart, and allow callers to get it back out.
We have to be a bit more careful about managing the lifetime of the
tempdir since some GerritServers, particularly in StandaloneSiteTest,
have a shorter lifetime than their tempdirs. Fortunately, TempFileUtil
make this relatively easy.

As a nice side effect, we can get rid of the hack of passing the tempdir
in via a Gerrit config option.

Change-Id: I80ac66a27bc990f2cef966c9b372c86ce277c471
2018-09-19 10:46:50 +09:00
..
src/test/java/com/google/gerrit/acceptance AbstractDaemonTest: Don't delete common server path too early 2018-09-19 10:46:50 +09:00
BUILD Run reindex test against Elasticsearch in addition to Lucene 2018-04-19 13:28:06 +02:00
tests.bzl Apply buildifier to .bzl files. 2018-07-10 20:38:52 +09:00