[ https://issues.apache.org/jira/browse/GEODE-8864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17294248#comment-17294248 ]
ASF GitHub Bot commented on GEODE-8864: --------------------------------------- sabbey37 commented on a change in pull request #5954: URL: https://github.com/apache/geode/pull/5954#discussion_r586037142 ########## File path: geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/hash/AbstractHScanIntegrationTest.java ########## @@ -219,13 +298,13 @@ public void givenCount_returnsAllEntriesWithoutDuplicates() { cursor = result.getCursor(); } while (!result.isCompleteIteration()); - assertThat(allEntries).hasSize(3); - assertThat(new HashSet<>(allEntries)).isEqualTo(entryMap.entrySet()); + assertThat(allEntries.size()).isCloseTo(3, Offset.offset(1)); Review comment: A few thoughts: - The test name is kinda misleading, since we say `returnsAllEntriesWithoutDuplicates`, but we are admitting the possibility of duplicates. - You could use lambdas (like you did in another part of the code) to remove any duplicates before the assertion, something like: ``` List<Map.Entry<String, String>> allEntriesWithoutDuplicates = allEntries.stream().distinct().collect(Collectors.toList()); ``` - But really none of the above matters because, thinking about it more, I realize that for most of our tests, the data is so small that native Redis is always going to return all the entries at once (per the `Why SCAN may return all the items of an aggregate data type in a single call?` section of the SCAN documentation as well as the Redis code (see `db.c` file, `scanGenericCommand` method)). So we can actually check that the size and entries match exactly what we expect. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > finish implementation of Redis HScan Command > -------------------------------------------- > > Key: GEODE-8864 > URL: https://issues.apache.org/jira/browse/GEODE-8864 > Project: Geode > Issue Type: New Feature > Components: redis > Reporter: John Hutchison > Priority: Major > Labels: blocks-1.14.0, pull-request-available > -- This message was sent by Atlassian Jira (v8.3.4#803005)