[TEST] randomize byte size and thread count in breaker tests

This commit is contained in:
Lee Hinman 2014-07-30 11:41:01 +02:00
parent dbcc4e9255
commit f9f8459c79
1 changed files with 6 additions and 6 deletions

View File

@ -41,8 +41,8 @@ public class MemoryCircuitBreakerTests extends ElasticsearchTestCase {
@Test
public void testThreadedUpdatesToBreaker() throws Exception {
final int NUM_THREADS = 5;
final int BYTES_PER_THREAD = 1000;
final int NUM_THREADS = scaledRandomIntBetween(3, 15);
final int BYTES_PER_THREAD = scaledRandomIntBetween(500, 4500);
final Thread[] threads = new Thread[NUM_THREADS];
final AtomicBoolean tripped = new AtomicBoolean(false);
final AtomicReference<Throwable> lastException = new AtomicReference<>(null);
@ -83,8 +83,8 @@ public class MemoryCircuitBreakerTests extends ElasticsearchTestCase {
@Test
public void testThreadedUpdatesToChildBreaker() throws Exception {
final int NUM_THREADS = 5;
final int BYTES_PER_THREAD = 1000;
final int NUM_THREADS = scaledRandomIntBetween(3, 15);
final int BYTES_PER_THREAD = scaledRandomIntBetween(500, 4500);
final Thread[] threads = new Thread[NUM_THREADS];
final AtomicBoolean tripped = new AtomicBoolean(false);
final AtomicReference<Throwable> lastException = new AtomicReference<>(null);
@ -141,8 +141,8 @@ public class MemoryCircuitBreakerTests extends ElasticsearchTestCase {
@Test
public void testThreadedUpdatesToChildBreakerWithParentLimit() throws Exception {
final int NUM_THREADS = 5;
final int BYTES_PER_THREAD = 1000;
final int NUM_THREADS = scaledRandomIntBetween(3, 15);
final int BYTES_PER_THREAD = scaledRandomIntBetween(500, 4500);
final Thread[] threads = new Thread[NUM_THREADS];
final AtomicInteger tripped = new AtomicInteger(0);
final AtomicReference<Throwable> lastException = new AtomicReference<>(null);