horizonzy commented on code in PR #2025:
URL: https://github.com/apache/zookeeper/pull/2025#discussion_r1251765568


##########
zookeeper-server/src/test/java/org/apache/zookeeper/server/persistence/FileTxnLogTest.java:
##########
@@ -171,20 +171,37 @@ public void testGetCurrentLogSize() throws Exception {
         FileTxnLog log = new FileTxnLog(tmpDir);
         FileTxnLog.setPreallocSize(PREALLOCATE);
         CreateRequest record = new CreateRequest(null, new byte[NODE_SIZE], 
ZooDefs.Ids.OPEN_ACL_UNSAFE, 0);
+        long logSize = 16;
+        long position = 16;
         int zxid = 1;
         for (int i = 0; i < 4; i++) {
             log.append(new TxnHeader(0, 0, zxid++, 0, 0), record);
-            LOG.debug("Current log size: {}", log.getCurrentLogSize());
+            logSize += PREALLOCATE;
+            assertEquals(logSize, log.getCurrentLogSize());
+            assertEquals(position, log.fos.getChannel().position());
         }
         log.commit();
-        LOG.info("Current log size: {}", log.getCurrentLogSize());
+        long totalSize = (8 + 4 + 1095 + 1) * 4 + 16;

Review Comment:
   Done



-- 
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: notifications-unsubscr...@zookeeper.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to