jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1145944 - /jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/util/CommitGateTest.java
Date Wed, 13 Jul 2011 10:09:18 GMT
Author: thomasm
Date: Wed Jul 13 10:09:18 2011
New Revision: 1145944

URL: http://svn.apache.org/viewvc?rev=1145944&view=rev
Log:
Fix the commit gate test.

Modified:
    jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/util/CommitGateTest.java

Modified: jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/util/CommitGateTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/util/CommitGateTest.java?rev=1145944&r1=1145943&r2=1145944&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/util/CommitGateTest.java
(original)
+++ jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/util/CommitGateTest.java
Wed Jul 13 10:09:18 2011
@@ -60,6 +60,8 @@ public class CommitGateTest extends Test
         Thread.sleep(waitMillis * 10);
         assertTrue(threadCount < spurious.get());
         assertEquals(10, tick.get());
+        tick.set(0);
+        spurious.set(0);
         int commitCount = 100;
         for (int i = 0; i < commitCount; i++) {
             gate.commit(Integer.toString(i));
@@ -69,7 +71,8 @@ public class CommitGateTest extends Test
         for (Thread j : threads) {
             j.join();
         }
-        assertTrue(tick.get() >= threadCount * commitCount);
+        assertTrue("ticks: " + tick.get() + " min: " + threadCount * commitCount + " spurious:
" +  spurious.get(),
+                tick.get() >= threadCount * commitCount * 0.8 && tick.get() <=
threadCount * commitCount * 1.2);
     }
 
 }



Mime
View raw message