eolivelli commented on code in PR #3917:
URL: https://github.com/apache/bookkeeper/pull/3917#discussion_r1165418967


##########
bookkeeper-server/src/test/java/org/apache/bookkeeper/client/BookieWriteLedgerTest.java:
##########
@@ -1454,6 +1467,67 @@ public void testLedgerCreateByteBufRefCnt() throws 
Exception {
         bkc.deleteLedger(lh.ledgerId);
     }
 
+    @Test
+    public void testReadLacNotSameWithMetadata() throws Exception {
+       lh = bkc.createLedger(3, 3, 2, digestType, ledgerPassword);
+        for (int i = 0; i < 10; ++i) {
+            ByteBuffer entry = ByteBuffer.allocate(4);
+            entry.putInt(rng.nextInt(maxInt));
+            entry.position(0);
+            lh.addEntry(entry.array());
+        }
+
+        List<BookieId> ensemble = 
lh.getLedgerMetadata().getAllEnsembles().entrySet().iterator().next().getValue();
+        assertEquals(1, lh.getLedgerMetadata().getAllEnsembles().size());
+        killBookie(ensemble.get(1));
+
+
+        try {
+            lh.ensembleChangeLoop(ensemble, Collections.singletonMap(1, 
ensemble.get(1)));
+        } catch (Exception e) {

Review Comment:
   Of we expect an exception we should add a fail() statement inside the try 
block.
   Maybe we could also perform some assertion over this Exception (optionally)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to