sashapolo commented on code in PR #2833:
URL: https://github.com/apache/ignite-3/pull/2833#discussion_r1390393302


##########
modules/table/src/integrationTest/java/org/apache/ignite/internal/raftsnapshot/ItTableRaftSnapshotsTest.java:
##########
@@ -551,10 +441,12 @@ void entriesKeepAppendedDuringSnapshotInstallation() 
throws Exception {
 
         transferLeadershipOnSolePartitionTo(2);
 
-        List<Integer> keys = queryWithRetry(2, "select * from test order by 
key", ItTableRaftSnapshotsTest::readRows)
-                .stream().map(IgniteBiTuple::get1).collect(toList());
+        List<Integer> expectedKeysAndNextKey = IntStream.rangeClosed(1, 
lastLoadedKey.get() + 1).boxed().collect(toList());
+        Map<Integer, String> keysToValues = tableViewAt(2).getAll(null, 
expectedKeysAndNextKey);
 
-        assertThat(keys, equalTo(IntStream.rangeClosed(1, 
lastLoadedKey.get()).boxed().collect(toList())));
+        Set<Integer> expectedKeys = IntStream.rangeClosed(1, 
lastLoadedKey.get()).boxed().collect(toSet());
+        assertThat(keysToValues.keySet(), equalTo(expectedKeys));
+        assertThat(new HashSet<>(keysToValues.values()), is(Set.of("one", 
"extra")));

Review Comment:
   No need to use sets here, you can use `containsInAnyOrder` matcher instead



##########
modules/table/src/integrationTest/java/org/apache/ignite/internal/raftsnapshot/ItTableRaftSnapshotsTest.java:
##########
@@ -291,9 +178,11 @@ private void testLeaderFeedsFollowerWithSnapshot(String 
storageEngine) throws Ex
 
         transferLeadershipOnSolePartitionTo(2);
 
-        List<IgniteBiTuple<Integer, String>> rows = queryWithRetry(2, "select 
* from test", ItTableRaftSnapshotsTest::readRows);
+        assertThat(getVia(2, 1), is("one"));
+    }
 
-        assertThat(rows, is(List.of(new IgniteBiTuple<>(1, "one"))));
+    private @Nullable String getVia(int clusterNode, int key) {

Review Comment:
   This method's name is confusing to me, can we rename it to `getFromNode`, 
for example?



##########
modules/table/src/integrationTest/java/org/apache/ignite/internal/raftsnapshot/ItTableRaftSnapshotsTest.java:
##########
@@ -347,12 +236,25 @@ private void prepareClusterForInstallingSnapshotToNode2(
 
         knockoutNode(2);
 
-        executeDmlWithRetry(0, "insert into test(key, val) values (1, 'one')");
+        putVia(0, 1, "one");
 
         // Make sure AppendEntries from leader to follower is impossible, 
making the leader to use InstallSnapshot.
         causeLogTruncationOnSolePartitionLeader(0);
     }
 
+    private void putVia(int nodeIndex, int key, String value) {

Review Comment:
   Same here



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