Balance request sizes in NettyHttpRequestSizeLimitIT

This test should demonstrate that a single (larger)
request is processed but on of multiple large concurrent requests
is rejected. This test broke too early under some circumstances in
network mode as the limit is quite low.

With this commit we reduce the size of the individual large
requests but issue more concurrent ones thus increasing stability
of this test.
This commit is contained in:
Daniel Mitterdorfer 2016-04-18 09:31:48 +02:00
parent 5ce3eb96b0
commit b9faa13274
1 changed files with 6 additions and 1 deletions

View File

@ -57,7 +57,7 @@ public class NettyHttpRequestSizeLimitIT extends ESIntegTestCase {
ensureGreen(); ensureGreen();
// we use the limit size as a (very) rough indication on how many requests we should sent to hit the limit // we use the limit size as a (very) rough indication on how many requests we should sent to hit the limit
int numRequests = LIMIT.bytesAsInt() / 50; int numRequests = LIMIT.bytesAsInt() / 100;
StringBuilder bulkRequest = new StringBuilder(); StringBuilder bulkRequest = new StringBuilder();
for (int i = 0; i < numRequests; i++) { for (int i = 0; i < numRequests; i++) {
@ -69,6 +69,11 @@ public class NettyHttpRequestSizeLimitIT extends ESIntegTestCase {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
Tuple<String, CharSequence>[] requests = new Tuple[] { Tuple<String, CharSequence>[] requests = new Tuple[] {
Tuple.tuple("/index/type/_bulk", bulkRequest),
Tuple.tuple("/index/type/_bulk", bulkRequest),
Tuple.tuple("/index/type/_bulk", bulkRequest),
Tuple.tuple("/index/type/_bulk", bulkRequest),
Tuple.tuple("/index/type/_bulk", bulkRequest),
Tuple.tuple("/index/type/_bulk", bulkRequest), Tuple.tuple("/index/type/_bulk", bulkRequest),
Tuple.tuple("/index/type/_bulk", bulkRequest), Tuple.tuple("/index/type/_bulk", bulkRequest),
Tuple.tuple("/index/type/_bulk", bulkRequest), Tuple.tuple("/index/type/_bulk", bulkRequest),