diff --git a/java/com/google/gerrit/elasticsearch/ElasticVersion.java b/java/com/google/gerrit/elasticsearch/ElasticVersion.java index 309ee3e5b9..574a22623a 100644 --- a/java/com/google/gerrit/elasticsearch/ElasticVersion.java +++ b/java/com/google/gerrit/elasticsearch/ElasticVersion.java @@ -30,7 +30,8 @@ public enum ElasticVersion { V7_1("7.1.*"), V7_2("7.2.*"), V7_3("7.3.*"), - V7_4("7.4.*"); + V7_4("7.4.*"), + V7_5("7.5.*"); private final String version; private final Pattern pattern; diff --git a/javatests/com/google/gerrit/acceptance/pgm/ElasticReindexIT.java b/javatests/com/google/gerrit/acceptance/pgm/ElasticReindexIT.java index dcdca860ff..eeeacab28e 100644 --- a/javatests/com/google/gerrit/acceptance/pgm/ElasticReindexIT.java +++ b/javatests/com/google/gerrit/acceptance/pgm/ElasticReindexIT.java @@ -37,7 +37,7 @@ public class ElasticReindexIT extends AbstractReindexTests { @ConfigSuite.Config public static Config elasticsearchV7() { - return getConfig(ElasticVersion.V7_4); + return getConfig(ElasticVersion.V7_5); } @Override diff --git a/javatests/com/google/gerrit/acceptance/ssh/ElasticIndexIT.java b/javatests/com/google/gerrit/acceptance/ssh/ElasticIndexIT.java index 1c41b558d4..1940274a6c 100644 --- a/javatests/com/google/gerrit/acceptance/ssh/ElasticIndexIT.java +++ b/javatests/com/google/gerrit/acceptance/ssh/ElasticIndexIT.java @@ -38,7 +38,7 @@ public class ElasticIndexIT extends AbstractIndexTests { @ConfigSuite.Config public static Config elasticsearchV7() { - return getConfig(ElasticVersion.V7_4); + return getConfig(ElasticVersion.V7_5); } @Override diff --git a/javatests/com/google/gerrit/elasticsearch/ElasticContainer.java b/javatests/com/google/gerrit/elasticsearch/ElasticContainer.java index c15f1a770d..c692a3b4f8 100644 --- a/javatests/com/google/gerrit/elasticsearch/ElasticContainer.java +++ b/javatests/com/google/gerrit/elasticsearch/ElasticContainer.java @@ -62,6 +62,8 @@ public class ElasticContainer extends ElasticsearchContainer { return "blacktop/elasticsearch:7.3.2"; case V7_4: return "blacktop/elasticsearch:7.4.2"; + case V7_5: + return "blacktop/elasticsearch:7.5.0"; } throw new IllegalStateException("No tests for version: " + version.name()); } diff --git a/javatests/com/google/gerrit/elasticsearch/ElasticV6QueryChangesTest.java b/javatests/com/google/gerrit/elasticsearch/ElasticV6QueryChangesTest.java index da64d539b3..d2c5fa03c8 100644 --- a/javatests/com/google/gerrit/elasticsearch/ElasticV6QueryChangesTest.java +++ b/javatests/com/google/gerrit/elasticsearch/ElasticV6QueryChangesTest.java @@ -22,7 +22,12 @@ import com.google.gerrit.testing.InMemoryModule; import com.google.gerrit.testing.IndexConfig; import com.google.inject.Guice; import com.google.inject.Injector; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.protocol.HttpClientContext; +import org.apache.http.impl.nio.client.CloseableHttpAsyncClient; +import org.apache.http.impl.nio.client.HttpAsyncClients; import org.eclipse.jgit.lib.Config; +import org.junit.After; import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Rule; @@ -35,6 +40,7 @@ public class ElasticV6QueryChangesTest extends AbstractQueryChangesTest { private static ElasticNodeInfo nodeInfo; private static ElasticContainer container; + private static CloseableHttpAsyncClient client; @BeforeClass public static void startIndexService() { @@ -45,6 +51,8 @@ public class ElasticV6QueryChangesTest extends AbstractQueryChangesTest { container = ElasticContainer.createAndStart(ElasticVersion.V6_8); nodeInfo = new ElasticNodeInfo(container.getHttpHost().getPort()); + client = HttpAsyncClients.createDefault(); + client.start(); } @AfterClass @@ -54,6 +62,16 @@ public class ElasticV6QueryChangesTest extends AbstractQueryChangesTest { } } + @After + public void closeIndex() { + client.execute( + new HttpPost( + String.format( + "http://localhost:%d/%s*/_close", nodeInfo.port, getSanitizedMethodName())), + HttpClientContext.create(), + null); + } + @Rule public final GerritTestName testName = new GerritTestName(); @Override diff --git a/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryAccountsTest.java b/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryAccountsTest.java index 021a80dc96..c55417e2d6 100644 --- a/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryAccountsTest.java +++ b/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryAccountsTest.java @@ -41,7 +41,7 @@ public class ElasticV7QueryAccountsTest extends AbstractQueryAccountsTest { return; } - container = ElasticContainer.createAndStart(ElasticVersion.V7_4); + container = ElasticContainer.createAndStart(ElasticVersion.V7_5); nodeInfo = new ElasticNodeInfo(container.getHttpHost().getPort()); } diff --git a/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryChangesTest.java b/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryChangesTest.java index 6bb2f8fb65..b4feb32f0a 100644 --- a/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryChangesTest.java +++ b/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryChangesTest.java @@ -51,7 +51,7 @@ public class ElasticV7QueryChangesTest extends AbstractQueryChangesTest { return; } - container = ElasticContainer.createAndStart(ElasticVersion.V7_4); + container = ElasticContainer.createAndStart(ElasticVersion.V7_5); nodeInfo = new ElasticNodeInfo(container.getHttpHost().getPort()); client = HttpAsyncClients.createDefault(); client.start(); diff --git a/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryGroupsTest.java b/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryGroupsTest.java index 9312f01212..c2d6246a06 100644 --- a/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryGroupsTest.java +++ b/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryGroupsTest.java @@ -41,7 +41,7 @@ public class ElasticV7QueryGroupsTest extends AbstractQueryGroupsTest { return; } - container = ElasticContainer.createAndStart(ElasticVersion.V7_4); + container = ElasticContainer.createAndStart(ElasticVersion.V7_5); nodeInfo = new ElasticNodeInfo(container.getHttpHost().getPort()); } diff --git a/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryProjectsTest.java b/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryProjectsTest.java index 4b9ede870b..2fc436682a 100644 --- a/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryProjectsTest.java +++ b/javatests/com/google/gerrit/elasticsearch/ElasticV7QueryProjectsTest.java @@ -41,7 +41,7 @@ public class ElasticV7QueryProjectsTest extends AbstractQueryProjectsTest { return; } - container = ElasticContainer.createAndStart(ElasticVersion.V7_4); + container = ElasticContainer.createAndStart(ElasticVersion.V7_5); nodeInfo = new ElasticNodeInfo(container.getHttpHost().getPort()); } diff --git a/javatests/com/google/gerrit/elasticsearch/ElasticVersionTest.java b/javatests/com/google/gerrit/elasticsearch/ElasticVersionTest.java index f9cfe35fbf..5d2f99c549 100644 --- a/javatests/com/google/gerrit/elasticsearch/ElasticVersionTest.java +++ b/javatests/com/google/gerrit/elasticsearch/ElasticVersionTest.java @@ -60,6 +60,9 @@ public class ElasticVersionTest { assertThat(ElasticVersion.forVersion("7.4.0")).isEqualTo(ElasticVersion.V7_4); assertThat(ElasticVersion.forVersion("7.4.1")).isEqualTo(ElasticVersion.V7_4); + + assertThat(ElasticVersion.forVersion("7.5.0")).isEqualTo(ElasticVersion.V7_5); + assertThat(ElasticVersion.forVersion("7.5.1")).isEqualTo(ElasticVersion.V7_5); } @Test @@ -89,6 +92,7 @@ public class ElasticVersionTest { assertThat(ElasticVersion.V7_2.isAtLeastMinorVersion(ElasticVersion.V6_7)).isFalse(); assertThat(ElasticVersion.V7_3.isAtLeastMinorVersion(ElasticVersion.V6_7)).isFalse(); assertThat(ElasticVersion.V7_4.isAtLeastMinorVersion(ElasticVersion.V6_7)).isFalse(); + assertThat(ElasticVersion.V7_5.isAtLeastMinorVersion(ElasticVersion.V6_7)).isFalse(); } @Test @@ -106,6 +110,7 @@ public class ElasticVersionTest { assertThat(ElasticVersion.V7_2.isV6OrLater()).isTrue(); assertThat(ElasticVersion.V7_3.isV6OrLater()).isTrue(); assertThat(ElasticVersion.V7_4.isV6OrLater()).isTrue(); + assertThat(ElasticVersion.V7_5.isV6OrLater()).isTrue(); } @Test @@ -123,5 +128,6 @@ public class ElasticVersionTest { assertThat(ElasticVersion.V7_2.isV7OrLater()).isTrue(); assertThat(ElasticVersion.V7_3.isV7OrLater()).isTrue(); assertThat(ElasticVersion.V7_4.isV7OrLater()).isTrue(); + assertThat(ElasticVersion.V7_5.isV7OrLater()).isTrue(); } } diff --git a/tools/nongoogle.bzl b/tools/nongoogle.bzl index eb1372a0a0..29e2d21ad9 100644 --- a/tools/nongoogle.bzl +++ b/tools/nongoogle.bzl @@ -69,8 +69,8 @@ def declare_nongoogle_deps(): # elasticsearch-rest-client explicitly depends on this version maven_jar( name = "httpcore-nio", - artifact = "org.apache.httpcomponents:httpcore-nio:4.4.11", - sha1 = "7d0a97d01d39cff9aa3e6db81f21fddb2435f4e6", + artifact = "org.apache.httpcomponents:httpcore-nio:4.4.12", + sha1 = "84cd29eca842f31db02987cfedea245af020198b", ) maven_jar( @@ -102,8 +102,8 @@ def declare_nongoogle_deps(): # and httpasyncclient as necessary. maven_jar( name = "elasticsearch-rest-client", - artifact = "org.elasticsearch.client:elasticsearch-rest-client:7.4.2", - sha1 = "f48725523c0b3402f869214433602f8d3f4c737c", + artifact = "org.elasticsearch.client:elasticsearch-rest-client:7.5.0", + sha1 = "62535b6fc3a4e943e88e7640eac22e29f03a696d", ) maven_jar(