jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1574414 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/observation/ObservationTest.java
Date Wed, 05 Mar 2014 10:39:12 GMT
Author: mduerig
Date: Wed Mar  5 10:39:12 2014
New Revision: 1574414

URL: http://svn.apache.org/r1574414
Log:
OAK-1491: ObservationTest failure on Windows
Add some instrumentation to test case to detect spurious wake-up on futures

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/observation/ObservationTest.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/observation/ObservationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/observation/ObservationTest.java?rev=1574414&r1=1574413&r2=1574414&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/observation/ObservationTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/observation/ObservationTest.java
Wed Mar  5 10:39:12 2014
@@ -80,7 +80,7 @@ public class ObservationTest extends Abs
     private static final String REFERENCEABLE_NODE = "\"referenceable\"";
     private static final String TEST_PATH = '/' + TEST_NODE;
     private static final String TEST_TYPE = "mix:test";
-    public static final int TIME_OUT = 2;
+    public static final int TIME_OUT = 4;
 
     private Session observingSession;
     private ObservationManager observationManager;
@@ -832,10 +832,15 @@ public class ObservationTest extends Abs
         public List<Expectation> getMissing(int time, TimeUnit timeUnit)
                 throws ExecutionException, InterruptedException {
             List<Expectation> missing = Lists.newArrayList();
+            long t0 = System.nanoTime();
             try {
                 Futures.allAsList(expected).get(time, timeUnit);
             }
             catch (TimeoutException e) {
+                long dt = System.nanoTime() - t0;
+                // TODO remove again once OAK-1491 is fixed
+                assertTrue("Spurious wak-up after " + 0,
+                        dt < 0.8*TimeUnit.NANOSECONDS.convert(time, timeUnit));
                 for (Expectation exp : expected) {
                     if (!exp.isDone()) {
                         missing.add(exp);



Mime
View raw message