timoninmaxim commented on a change in pull request #9719:
URL: https://github.com/apache/ignite/pull/9719#discussion_r783723966



##########
File path: 
modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/wal/reader/StandaloneWalRecordsIteratorTest.java
##########
@@ -144,6 +153,117 @@ public void testCorrectClosingFileDescriptors() throws 
Exception {
         );
     }
 
+    /** */
+    @Test
+    public void testNoNextIfLowBoundInTheEnd() throws Exception {
+        String dir = createWalFiles(3);
+
+        WALIterator iter = createWalIterator(dir, null, null, false);
+
+        assertFalse(iter.lastRead().isPresent());
+
+        while (iter.hasNext()) {
+            IgniteBiTuple<WALPointer, WALRecord> curr = iter.next();
+
+            assertEquals("Last read should point to the current record", 
curr.get1(), iter.lastRead().get());
+        }
+
+        iter.close();
+
+        iter = createWalIterator(dir, iter.lastRead().get().next(), null, 
false);
+
+        assertFalse(iter.lastRead().isPresent());
+
+        assertFalse(iter.hasNext());
+
+        iter.close();
+    }
+
+    /** */
+    @Test
+    public void testNextRecordReturnedForLowBounds() throws Exception {
+        String dir = createWalFiles(3);
+
+        WALIterator iter = createWalIterator(dir, null, null, false);
+
+        IgniteBiTuple<WALPointer, WALRecord> prev = iter.next();
+
+        assertEquals("Last read should point to the current record", 
prev.get1(), iter.lastRead().get());
+
+        iter.close();
+
+        iter = createWalIterator(dir, iter.lastRead().get().next(), null, 
false);
+
+        assertFalse(iter.lastRead().isPresent());
+
+        while (iter.hasNext()) {

Review comment:
       Let's add here assertTrue(iter.hasNext()).




-- 
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