syncope-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ilgro...@apache.org
Subject [1/2] syncope git commit: Reduing the thread number to avoid OutOfMemory errors on some platforms
Date Wed, 04 Mar 2015 07:58:06 GMT
Repository: syncope
Updated Branches:
  refs/heads/1_2_X 312897e87 -> c6640c99c
  refs/heads/master bb468d133 -> 350b3bd24


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/c6640c99
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/c6640c99
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/c6640c99

Branch: refs/heads/1_2_X
Commit: c6640c99c2cc7d242ba5b7f279de2c967c8cce40
Parents: 312897e
Author: Francesco Chicchiriccò <ilgrosso@apache.org>
Authored: Wed Mar 4 08:31:05 2015 +0100
Committer: Francesco Chicchiriccò <ilgrosso@apache.org>
Committed: Wed Mar 4 08:31:05 2015 +0100

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


http://git-wip-us.apache.org/repos/asf/syncope/blob/c6640c99/client/src/test/java/org/apache/syncope/client/ConcurrencyTest.java
----------------------------------------------------------------------
diff --git a/client/src/test/java/org/apache/syncope/client/ConcurrencyTest.java b/client/src/test/java/org/apache/syncope/client/ConcurrencyTest.java
index c7228c3..8c599db 100644
--- a/client/src/test/java/org/apache/syncope/client/ConcurrencyTest.java
+++ b/client/src/test/java/org/apache/syncope/client/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