From 409492808fef3fd1120f275f86d8694d26a10bc8 Mon Sep 17 00:00:00 2001 From: jaymode Date: Fri, 1 Dec 2017 09:40:53 -0700 Subject: [PATCH] Test: bound number of requests in IndexLifecycleManagerIntegTests The IndexLifecycleManagerIntegTests has a method that tests concurrency and executes a large number of requests in parallel. On some machines, this can actually overwhelm a thread pool and cause the test to fail for the wrong reasons. This commit bounds the total number of requests to 100. Original commit: elastic/x-pack-elasticsearch@07613ada51f9a67e95067c3d2f721d378416a54e --- .../security/support/IndexLifecycleManagerIntegTests.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/src/test/java/org/elasticsearch/xpack/security/support/IndexLifecycleManagerIntegTests.java b/plugin/src/test/java/org/elasticsearch/xpack/security/support/IndexLifecycleManagerIntegTests.java index e2e2d7ca1ea..e08051959f0 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/security/support/IndexLifecycleManagerIntegTests.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/security/support/IndexLifecycleManagerIntegTests.java @@ -27,7 +27,8 @@ public class IndexLifecycleManagerIntegTests extends SecurityIntegTestCase { assertSecurityIndexWriteable(); final int processors = Runtime.getRuntime().availableProcessors(); final int numThreads = scaledRandomIntBetween((processors + 1) / 2, 4 * processors); - final int numRequests = scaledRandomIntBetween(4, 16); + final int maxNumRequests = 100 / numThreads; // bound to a maximum of 100 requests + final int numRequests = scaledRandomIntBetween(4, maxNumRequests); final List> futures = new CopyOnWriteArrayList<>(); final List exceptions = new CopyOnWriteArrayList<>();