This is an automated email from the ASF dual-hosted git repository.

jgallimore pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git


The following commit(s) were added to refs/heads/master by this push:
     new e1831cb  Extract some of the values in the test into constant 
definitions. Reduce the size of the pool to very small amount so that when test 
is run on high core CPU's it will not fail.
     new 24dbf5e  Merge pull request #481 from 
doychin/fix-max-size-pool-endpoint-handler-test
e1831cb is described below

commit e1831cb4502586714bf66362f298755f30d74381
Author: Doychin Bondzhev <[email protected]>
AuthorDate: Sat Jun 8 17:09:47 2019 +0300

    Extract some of the values in the test into constant definitions.
    Reduce the size of the pool to very small amount so that when test is run 
on high core CPU's it will not fail.
    
    Signed-off-by: Doychin Bondzhev <[email protected]>
---
 .../openejb/core/mdb/MaxSizePoolEndpointHandlerTest.java      | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git 
a/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/MaxSizePoolEndpointHandlerTest.java
 
b/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/MaxSizePoolEndpointHandlerTest.java
index af50393..e52e986 100644
--- 
a/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/MaxSizePoolEndpointHandlerTest.java
+++ 
b/container/openejb-core/src/test/java/org/apache/openejb/core/mdb/MaxSizePoolEndpointHandlerTest.java
@@ -53,6 +53,8 @@ import static org.junit.Assert.assertTrue;
 public class MaxSizePoolEndpointHandlerTest {
 
     private static final String TEXT = "foo";
+    private static final int COUNT = 100;
+    private static final int POOL_SIZE = 5;
 
     @Configuration
     public Properties config() {
@@ -63,7 +65,7 @@ public class MaxSizePoolEndpointHandlerTest {
             .p("mdbs", "new://Container?type=MESSAGE")
             .p("mdbs.ResourceAdapter", "sra")
             .p("mdbs.pool", "true")
-            .p("mdbs.maxSize", "30")
+            .p("mdbs.maxSize", "" + POOL_SIZE)
             .p("mdbs.ActivationSpecClass", 
SampleActivationSpec.class.getName())
             .p("mdbs.MessageListenerInterface", 
InboundListener.class.getName())
 
@@ -93,7 +95,7 @@ public class MaxSizePoolEndpointHandlerTest {
     public void shouldSendMessage() throws Exception {
         assertNotNull(cf);
 
-        for (int i = 0; i < 100; i++) {
+        for (int i = 0; i < COUNT; i++) {
             final SampleConnection connection = cf.getConnection();
             try {
                 connection.sendMessage(TEXT);
@@ -106,7 +108,7 @@ public class MaxSizePoolEndpointHandlerTest {
         setControl("start");
 
         assertTrue(Listener.sync());
-        assertEquals(30, Listener.COUNTER.get());
+        assertEquals(POOL_SIZE, Listener.COUNTER.get());
     }
 
     private void setControl(final String action) throws Exception {
@@ -131,7 +133,8 @@ public class MaxSizePoolEndpointHandlerTest {
         }
 
         public static void reset() {
-            latch = new CountDownLatch(100);
+            latch = new CountDownLatch(COUNT);
+            COUNTER.set(0);
             BOOLEANS.clear();
         }
 

Reply via email to