syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [2/2] syncope git commit: Reduing the thread number to avoid OutOfMemory errors on some platforms
Date Wed, 04 Mar 2015 07:58:07 GMT
Reduing the thread number to avoid OutOfMemory errors on some platforms


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/350b3bd2
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/350b3bd2
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/350b3bd2

Branch: refs/heads/master
Commit: 350b3bd2482decdaf696ee8b1ffdfaf045513bae
Parents: bb468d1
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Wed Mar 4 08:57:59 2015 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Wed Mar 4 08:57:59 2015 +0100

----------------------------------------------------------------------
 .../java/org/apache/syncope/client/lib/ConcurrencyTest.java  | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/350b3bd2/client/lib/src/test/java/org/apache/syncope/client/lib/ConcurrencyTest.java
----------------------------------------------------------------------
diff --git a/client/lib/src/test/java/org/apache/syncope/client/lib/ConcurrencyTest.java b/client/lib/src/test/java/org/apache/syncope/client/lib/ConcurrencyTest.java
index 4657b2f..cbd7793 100644
--- a/client/lib/src/test/java/org/apache/syncope/client/lib/ConcurrencyTest.java
+++ b/client/lib/src/test/java/org/apache/syncope/client/lib/ConcurrencyTest.java
@@ -30,6 +30,8 @@ public class ConcurrencyTest {
 
     private static final Logger LOG = LoggerFactory.getLogger(ConcurrencyTest.class);
 
+    private static final int THREAD_NUMBER = 1000;
+
     private static final SyncopeClient client =
             new SyncopeClientFactoryBean().setAddress("http://url").create("username", "password");
 
@@ -37,7 +39,7 @@ public class ConcurrencyTest {
     public void multiThreadTest()
             throws InterruptedException {
 
-        for (int i = 0; i < 10000; i++) {
+        for (int i = 0; i < THREAD_NUMBER; i++) {
             Thread execution = new Thread("Th-" + StringUtils.leftPad(String.valueOf(i),
5, '0')) {
 
                 @Override
@@ -55,13 +57,13 @@ public class ConcurrencyTest {
             execution.start();
         }
 
-        Thread.sleep(10000);
+        Thread.sleep(THREAD_NUMBER);
     }
 
     @Test
     public void multiCallTest() {
         try {
-            for (int i = 0; i < 10000; i++) {
+            for (int i = 0; i < THREAD_NUMBER; i++) {
                 client.getService(ResourceService.class);
             }
         } catch (Exception e) {


Mime
View raw message