From 23726ece0039013e670aa154d36ce34eb29593eb Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Wed, 27 May 2015 19:53:49 -0400 Subject: [PATCH] tone down test --- .../script/python/PythonScriptMultiThreadedTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/java/org/elasticsearch/script/python/PythonScriptMultiThreadedTest.java b/src/test/java/org/elasticsearch/script/python/PythonScriptMultiThreadedTest.java index 903f6318761..9d53507388b 100644 --- a/src/test/java/org/elasticsearch/script/python/PythonScriptMultiThreadedTest.java +++ b/src/test/java/org/elasticsearch/script/python/PythonScriptMultiThreadedTest.java @@ -52,7 +52,7 @@ public class PythonScriptMultiThreadedTest extends ElasticsearchTestCase { final Object compiled = se.compile("x + y"); final AtomicBoolean failed = new AtomicBoolean(); - Thread[] threads = new Thread[50]; + Thread[] threads = new Thread[4]; final CountDownLatch latch = new CountDownLatch(threads.length); final CyclicBarrier barrier = new CyclicBarrier(threads.length + 1); for (int i = 0; i < threads.length; i++) { @@ -68,7 +68,7 @@ public class PythonScriptMultiThreadedTest extends ElasticsearchTestCase { vars.put("x", x); vars.put("y", y); ExecutableScript script = se.executable(compiled, vars); - for (int i = 0; i < 100000; i++) { + for (int i = 0; i < 10000; i++) { long result = ((Number) script.run()).longValue(); assertThat(result, equalTo(addition)); } @@ -138,7 +138,7 @@ public class PythonScriptMultiThreadedTest extends ElasticsearchTestCase { final Object compiled = se.compile("x + y"); final AtomicBoolean failed = new AtomicBoolean(); - Thread[] threads = new Thread[50]; + Thread[] threads = new Thread[4]; final CountDownLatch latch = new CountDownLatch(threads.length); final CyclicBarrier barrier = new CyclicBarrier(threads.length + 1); for (int i = 0; i < threads.length; i++) { @@ -148,7 +148,7 @@ public class PythonScriptMultiThreadedTest extends ElasticsearchTestCase { try { barrier.await(); Map runtimeVars = new HashMap(); - for (int i = 0; i < 100000; i++) { + for (int i = 0; i < 10000; i++) { long x = ThreadLocalRandom.current().nextInt(); long y = ThreadLocalRandom.current().nextInt(); long addition = x + y;