GerritServer: save gerrit.config before site init
Do so as already done in 2.15 and master versions.
Fix ElasticReindexIT so it passes also with this change. Contrary to
Lucene, configuring the Elasticsearch index type currently assumes
uninitialized indices -in Elasticsearch. Thus fix the test so it first
asserts that assumption, then reindexes or initializes indices offline.
The test then keeps testing as currently the case also for ReindexIT,
i.e., through their common parent test class methods.
Bug: Issue 8799
Change-Id: Ie52ea03a781c89fb3caf0f965f6fca1fb6c6a478
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 b560c5f..c4900de 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 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 @@
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) {