showuon commented on a change in pull request #11337:
URL: https://github.com/apache/kafka/pull/11337#discussion_r711430994



##########
File path: 
streams/src/test/java/org/apache/kafka/streams/state/internals/AbstractSessionBytesStoreTest.java
##########
@@ -195,18 +195,18 @@ public void 
shouldBackwardFetchAllSessionsWithSameRecordKey() {
         sessionStore.put(new Windowed<>("aa", new SessionWindow(0, 0)), 5L);
 
         try (final KeyValueIterator<Windowed<String>, Long> values = 
sessionStore.backwardFetch("a")) {
-            assertEquals(new HashSet<>(expected), toSet(values));
+            assertEquals(toList(expected.descendingIterator()), 
toList(values));
         }
     }
 
     @Test
     public void shouldFetchAllSessionsWithinKeyRange() {
-        final List<KeyValue<Windowed<String>, Long>> expected = Arrays.asList(
-            KeyValue.pair(new Windowed<>("aa", new SessionWindow(10, 10)), 2L),
-            KeyValue.pair(new Windowed<>("b", new SessionWindow(1000, 1000)), 
4L),
-
-            KeyValue.pair(new Windowed<>("aaa", new SessionWindow(100, 100)), 
3L),
-            KeyValue.pair(new Windowed<>("bb", new SessionWindow(1500, 2000)), 
5L));
+        final List<KeyValue<Windowed<String>, Long>> expected = new 
LinkedList<>();
+        expected.add(KeyValue.pair(new Windowed<>("aa", new SessionWindow(10, 
10)), 2L));
+        expected.add(KeyValue.pair(new Windowed<>("aaa", new 
SessionWindow(100, 100)), 3L));
+        expected.add(KeyValue.pair(new Windowed<>("aaaa", new 
SessionWindow(100, 100)), 6L));

Review comment:
       add a data with the same `SessionWindow(100, 100)`. So we can test if 
the fetch/backwardFetch can return data in correct order for both 
`InMemorySessionStore` and `RocksDBSessionStore`.




-- 
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: jira-unsubscr...@kafka.apache.org

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


Reply via email to