Author: schor
Date: Fri May  2 21:45:12 2014
New Revision: 1592049

URL: http://svn.apache.org/r1592049
Log:
[UIMA-3799] limit number of threads in tests to 50

Modified:
    
uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/analysis_engine/impl/AnalysisEngineDescription_implTest.java
    
uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/impl/CasPoolTest.java
    
uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IteratorTest.java

Modified: 
uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/analysis_engine/impl/AnalysisEngineDescription_implTest.java
URL: 
http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/analysis_engine/impl/AnalysisEngineDescription_implTest.java?rev=1592049&r1=1592048&r2=1592049&view=diff
==============================================================================
--- 
uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/analysis_engine/impl/AnalysisEngineDescription_implTest.java
 (original)
+++ 
uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/analysis_engine/impl/AnalysisEngineDescription_implTest.java
 Fri May  2 21:45:12 2014
@@ -311,7 +311,7 @@ public class AnalysisEngineDescription_i
     p.put(Resource.PARAM_CONFIG_MANAGER, configManager);
     p.put(Resource.PARAM_RESOURCE_MANAGER,  
UIMAFramework.newDefaultResourceManager());
     p.put(Resource.PARAM_UIMA_CONTEXT, uimaContext);
-    int numberOfThreads = MultiThreadUtils.PROCESSORS * 5; 
+    int numberOfThreads = Math.min(50, MultiThreadUtils.PROCESSORS * 5); 
     final AnalysisEngine[] aes = new AnalysisEngine[numberOfThreads];
     System.out.format("test multicore initialize with %d threads%n",
         numberOfThreads);

Modified: 
uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/impl/CasPoolTest.java
URL: 
http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/impl/CasPoolTest.java?rev=1592049&r1=1592048&r2=1592049&view=diff
==============================================================================
--- 
uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/impl/CasPoolTest.java
 (original)
+++ 
uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/impl/CasPoolTest.java
 Fri May  2 21:45:12 2014
@@ -79,7 +79,7 @@ public class CasPoolTest extends TestCas
   public void testMultiThread() throws Exception {
     final Properties p = new Properties();
     p.put(UIMAFramework.CAS_INITIAL_HEAP_SIZE,  200);   
-    int numberOfThreads = MultiThreadUtils.PROCESSORS * 10;    
+    int numberOfThreads = Math.min(50, MultiThreadUtils.PROCESSORS * 10);    
     final int casPoolSize = numberOfThreads / 3 ;
     System.out.format("test multicore iterator with %d threads and %d CASes",
         numberOfThreads, casPoolSize);

Modified: 
uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IteratorTest.java
URL: 
http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IteratorTest.java?rev=1592049&r1=1592048&r2=1592049&view=diff
==============================================================================
--- 
uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IteratorTest.java
 (original)
+++ 
uima/uimaj/trunk/uimaj-core/src/test/java/org/apache/uima/cas/test/IteratorTest.java
 Fri May  2 21:45:12 2014
@@ -236,7 +236,7 @@ public class IteratorTest extends TestCa
     final FSIndex<FeatureStructure> sortedIndex = 
this.cas.getIndexRepository().getIndex(
         CASTestSetup.ANNOT_SORT_INDEX);
   
-    int numberOfCores = Runtime.getRuntime().availableProcessors() * 5;
+    int numberOfCores = Math.min(50, 
Runtime.getRuntime().availableProcessors() * 5);
     
     System.out.println("test multicore iterator with " + numberOfCores + " 
threads");
     Thread[] threads = new Thread[numberOfCores];


Reply via email to