91d8fe01f9
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 |
||
---|---|---|
.. | ||
src/test/java/com/google/gerrit/acceptance | ||
BUILD | ||
tests.bzl |