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@07613ada51
This commit is contained in:
jaymode 2017-12-01 09:40:53 -07:00
parent f816b2e850
commit 409492808f
1 changed files with 2 additions and 1 deletions

View File

@ -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<ActionFuture<PutUserResponse>> futures = new CopyOnWriteArrayList<>();
final List<Exception> exceptions = new CopyOnWriteArrayList<>();