From 40d315b2445023d1fbcf4829bca9066ec5143fed Mon Sep 17 00:00:00 2001 From: jaymode Date: Thu, 18 Jan 2018 12:07:30 -0700 Subject: [PATCH] Test: only use a single shard in RemoteIndexAuditTrailStartingTests Relates elastic/x-pack-elasticsearch#435 Original commit: elastic/x-pack-elasticsearch@05db61297b86f89a39fa513c7b02f742178c2dec --- .../index/RemoteIndexAuditTrailStartingTests.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugin/src/test/java/org/elasticsearch/xpack/security/audit/index/RemoteIndexAuditTrailStartingTests.java b/plugin/src/test/java/org/elasticsearch/xpack/security/audit/index/RemoteIndexAuditTrailStartingTests.java index 6cd03fa80e9..765200a12a6 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/security/audit/index/RemoteIndexAuditTrailStartingTests.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/security/audit/index/RemoteIndexAuditTrailStartingTests.java @@ -28,7 +28,6 @@ import java.io.Closeable; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.List; import java.util.Optional; import java.util.Set; @@ -74,6 +73,11 @@ public class RemoteIndexAuditTrailStartingTests extends SecurityIntegTestCase { return Sets.newHashSet(SecurityLifecycleService.SECURITY_TEMPLATE_NAME, IndexAuditTrail.INDEX_TEMPLATE_NAME); } + @Override + protected int numberOfShards() { + return 1; // limit ourselves to a single shard in order to avoid timeout issues with large numbers of shards in tests + } + @Before public void startRemoteCluster() throws IOException, InterruptedException { final List addresses = new ArrayList<>(); @@ -102,7 +106,9 @@ public class RemoteIndexAuditTrailStartingTests extends SecurityIntegTestCase { .put("xpack.security.audit.outputs", randomFrom("index", "index,logfile")) .putList("xpack.security.audit.index.client.hosts", addresses.toArray(new String[addresses.size()])) .put("xpack.security.audit.index.client.cluster.name", clusterName) - .put("xpack.security.audit.index.client.xpack.security.user", TEST_USER_NAME + ":" + TEST_PASSWORD); + .put("xpack.security.audit.index.client.xpack.security.user", TEST_USER_NAME + ":" + TEST_PASSWORD) + .put("xpack.security.audit.index.settings.index.number_of_shards", 1) + .put("xpack.security.audit.index.settings.index.number_of_replicas", 0); addClientSSLSettings(builder, "xpack.security.audit.index.client."); builder.put("xpack.security.audit.index.client.xpack.security.transport.ssl.enabled", sslEnabled);