diff --git a/gerrit-acceptance-framework/src/test/java/com/google/gerrit/acceptance/GerritServer.java b/gerrit-acceptance-framework/src/test/java/com/google/gerrit/acceptance/GerritServer.java index 1d7ea103fd..bb3cab86fa 100644 --- a/gerrit-acceptance-framework/src/test/java/com/google/gerrit/acceptance/GerritServer.java +++ b/gerrit-acceptance-framework/src/test/java/com/google/gerrit/acceptance/GerritServer.java @@ -185,6 +185,15 @@ public class GerritServer implements AutoCloseable { checkArgument(!desc.memory(), "can't initialize site path for in-memory test: %s", desc); Config cfg = desc.buildConfig(baseConfig); Map pluginConfigs = desc.buildPluginConfigs(); + + MergeableFileBasedConfig gerritConfig = + new MergeableFileBasedConfig( + site.resolve("etc").resolve("gerrit.config").toFile(), FS.DETECTED); + gerritConfig.load(); + gerritConfig.merge(cfg); + mergeTestConfig(gerritConfig); + gerritConfig.save(); + Init init = new Init(); int rc = init.main( @@ -195,14 +204,6 @@ public class GerritServer implements AutoCloseable { throw new RuntimeException("Couldn't initialize site"); } - MergeableFileBasedConfig gerritConfig = - new MergeableFileBasedConfig( - site.resolve("etc").resolve("gerrit.config").toFile(), FS.DETECTED); - gerritConfig.load(); - gerritConfig.merge(cfg); - mergeTestConfig(gerritConfig); - gerritConfig.save(); - for (String pluginName : pluginConfigs.keySet()) { MergeableFileBasedConfig pluginCfg = new MergeableFileBasedConfig( diff --git a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/pgm/ElasticReindexIT.java b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/pgm/ElasticReindexIT.java index b560c5f8cf..c4900de40a 100644 --- a/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/pgm/ElasticReindexIT.java +++ b/gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/pgm/ElasticReindexIT.java @@ -23,6 +23,7 @@ import com.google.inject.Injector; import java.util.UUID; import org.eclipse.jgit.lib.Config; import org.junit.After; +import org.junit.Before; public class ElasticReindexIT extends AbstractReindexTests { private static ElasticContainer container; @@ -62,6 +63,12 @@ public class ElasticReindexIT extends AbstractReindexTests { ElasticTestUtils.createAllIndexes(injector); } + @Before + public void reindexFirstSinceElastic() throws Exception { + assertServerStartupFails(); + runGerrit("reindex", "-d", sitePaths.site_path.toString(), "--show-stack-trace"); + } + @After public void stopElasticServer() { if (container != null) {