zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iv...@apache.org
Subject svn commit: r1336569 - in /zookeeper/bookkeeper/trunk: CHANGES.txt hedwig-server/pom.xml hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestBookkeeperPersistenceManagerWhiteBox.java
Date Thu, 10 May 2012 09:57:39 GMT
Author: ivank
Date: Thu May 10 09:57:39 2012
New Revision: 1336569

URL: http://svn.apache.org/viewvc?rev=1336569&view=rev
Log:
BOOKKEEPER-245: Intermittent failures in PersistanceManager tests (ivank)

Modified:
    zookeeper/bookkeeper/trunk/CHANGES.txt
    zookeeper/bookkeeper/trunk/hedwig-server/pom.xml
    zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestBookkeeperPersistenceManagerWhiteBox.java

Modified: zookeeper/bookkeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/CHANGES.txt?rev=1336569&r1=1336568&r2=1336569&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/CHANGES.txt (original)
+++ zookeeper/bookkeeper/trunk/CHANGES.txt Thu May 10 09:57:39 2012
@@ -122,6 +122,8 @@ Trunk (unreleased changes)
 
         BOOKKEEPER-215: Deadlock occurs under high load (sijie via ivank)
 
+        BOOKKEEPER-245: Intermittent failures in PersistanceManager tests (ivank)
+
       bookkeeper-benchmark/
 	
 	BOOKKEEPER-207: BenchBookie doesn't run correctly (ivank via fpj)

Modified: zookeeper/bookkeeper/trunk/hedwig-server/pom.xml
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/pom.xml?rev=1336569&r1=1336568&r2=1336569&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/pom.xml (original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/pom.xml Thu May 10 09:57:39 2012
@@ -58,7 +58,7 @@
     <dependency>
     	<groupId>org.apache.derby</groupId>
     	<artifactId>derby</artifactId>
-    	<version>10.4.2.0</version>
+    	<version>10.8.2.2</version>
     	<scope>runtime</scope>
     </dependency>
     <dependency>

Modified: zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestBookkeeperPersistenceManagerWhiteBox.java
URL: http://svn.apache.org/viewvc/zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestBookkeeperPersistenceManagerWhiteBox.java?rev=1336569&r1=1336568&r2=1336569&view=diff
==============================================================================
--- zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestBookkeeperPersistenceManagerWhiteBox.java
(original)
+++ zookeeper/bookkeeper/trunk/hedwig-server/src/test/java/org/apache/hedwig/server/persistence/TestBookkeeperPersistenceManagerWhiteBox.java
Thu May 10 09:57:39 2012
@@ -28,6 +28,7 @@ import org.apache.bookkeeper.client.Book
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.apache.hedwig.util.Either;
 
 import com.google.protobuf.ByteString;
 import org.apache.hedwig.HelperMethods;
@@ -114,11 +115,20 @@ public class TestBookkeeperPersistenceMa
             index++;
         }
 
+        // ensure the bkpm has the topic before scanning
+        StubCallback<Void> stubCallback = new StubCallback<Void>();
+        bkpm.acquiredTopic(topic, stubCallback, null);
+
         // Lets scan now
         StubScanCallback scanCallback = new StubScanCallback();
         bkpm.scanMessages(new RangeScanRequest(topic, 1, NUM_MESSAGES_TO_TEST, Long.MAX_VALUE,
scanCallback, null));
         for (int i = 0; i < messages.size(); i++) {
-            Message scannedMessage = ConcurrencyUtils.take(scanCallback.queue).left();
+            Either<Message,Exception> e = ConcurrencyUtils.take(scanCallback.queue);
+            Message scannedMessage = e.left();
+            if (scannedMessage == null) {
+                throw e.right();
+            }
+
             assertTrue(messages.get(i).getBody().equals(scannedMessage.getBody()));
             assertEquals(i + 1, scannedMessage.getMsgId().getLocalComponent());
         }



Mime
View raw message