[jboss-cvs] JBoss Messaging SVN: r2462 - trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Feb 27 00:30:42 EST 2007


Author: clebert.suconic at jboss.com
Date: 2007-02-27 00:30:42 -0500 (Tue, 27 Feb 2007)
New Revision: 2462

Modified:
   trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RedistributionWithDefaultMessagePullPolicyTest.java
Log:
I ran this test several other times and I got racings between statistics and these assertions... so I'm adding these sleeps

Modified: trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RedistributionWithDefaultMessagePullPolicyTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RedistributionWithDefaultMessagePullPolicyTest.java	2007-02-27 04:13:22 UTC (rev 2461)
+++ trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RedistributionWithDefaultMessagePullPolicyTest.java	2007-02-27 05:30:42 UTC (rev 2462)
@@ -895,6 +895,7 @@
          queue5.deliver();
          receiver5.waitForHandleInvocations(NUM_MESSAGES - 25, 20000);
          
+         // Waiting time for statistics to kick in on MessagePullPolicy, avoiding races
          Thread.sleep(20000);
 
          log.trace("receiver5 msgs:" + receiver5.getMessages().size());
@@ -944,9 +945,10 @@
          receiver5.setMaxRefs(5);
          queue5.deliver();
          receiver5.waitForHandleInvocations(5, 20000);
-         
-         Thread.sleep(4000);
 
+         // Waiting time for statistics to kick in on MessagePullPolicy, avoiding races
+         Thread.sleep(20000);
+
          log.trace("Here are the sizes 4:");
          log.trace("queue1, refs:" + queue1.memoryRefCount() + " dels:" + queue1.getDeliveringCount());
          log.trace("queue2, refs:" + queue2.memoryRefCount() + " dels:" + queue2.getDeliveringCount());
@@ -988,7 +990,8 @@
          queue5.deliver();
          receiver5.waitForHandleInvocations(1, 20000);
          
-         Thread.sleep(2000);
+         // Waiting time for statistics to kick in on MessagePullPolicy, avoiding races
+         Thread.sleep(20000);
 
          log.trace("Here are the sizes 5:");
          log.trace("queue1, refs:" + queue1.memoryRefCount() + " dels:" + queue1.getDeliveringCount());
@@ -1031,7 +1034,8 @@
          queue4.deliver();
          receiver4.waitForHandleInvocations(num, 20000);
          
-         Thread.sleep(2000);
+         // Waiting time for statistics to kick in on MessagePullPolicy, avoiding races
+         Thread.sleep(20000);
 
          log.trace("Here are the sizes 6:");
          log.trace("queue1, refs:" + queue1.memoryRefCount() + " dels:" + queue1.getDeliveringCount());




More information about the jboss-cvs-commits mailing list