albertogpz commented on code in PR #7493: URL: https://github.com/apache/geode/pull/7493#discussion_r859978846
########## geode-core/src/distributedTest/java/org/apache/geode/internal/cache/execute/PRClientServerRegionFunctionExecutionNoSingleHopDistributedTest.java: ########## @@ -740,191 +712,163 @@ private static void serverMultiKeyExecutionOnASingleBucket(Boolean isByName) { } DistributedSystem.setThreadsSocketPolicy(false); for (String o : testKeysSet) { - try { - Set<String> singleKeySet = Collections.singleton(o); - Function function = new TestFunction(true, TEST_FUNCTION2); - FunctionService.registerFunction(function); - Execution dataSet = FunctionService.onRegion(region); - ResultCollector rc1 = execute(dataSet, singleKeySet, Boolean.TRUE, function, isByName); - List l = ((List) rc1.getResult()); - assertEquals(1, l.size()); - - ResultCollector rc2 = - execute(dataSet, singleKeySet, new HashSet<>(singleKeySet), function, isByName); - List l2 = ((List) rc2.getResult()); - - assertEquals(1, l2.size()); - List subList = (List) l2.iterator().next(); - assertEquals(1, subList.size()); - assertEquals(region.get(singleKeySet.iterator().next()), subList.iterator().next()); - } catch (Exception expected) { - logger.info("Exception : " + expected.getMessage()); - expected.printStackTrace(); - fail("Test failed after the put operation"); - } + Set<String> singleKeySet = Collections.singleton(o); + Function<Object> function = new TestFunction<>(true, TEST_FUNCTION2); + FunctionService.registerFunction(function); + Execution dataSet = FunctionService.onRegion(region); + ResultCollector<?, ?> rc1 = execute(dataSet, singleKeySet, Boolean.TRUE, function, isByName); + List<?> l = (List<?>) rc1.getResult(); + assertThat(l.size()).isEqualTo(1); + + ResultCollector<?, ?> rc2 = + execute(dataSet, singleKeySet, new HashSet<>(singleKeySet), function, isByName); + List<?> l2 = (List<?>) rc2.getResult(); + + assertThat(l2.size()).isEqualTo(1); + List<?> subList = (List<?>) l2.iterator().next(); + assertThat(subList.size()).isEqualTo(1); + assertThat(subList.iterator().next()).isEqualTo(region.get(singleKeySet.iterator().next())); Review Comment: Almost. It should be: `assertThat(subList).containsOnly(region.get(singleKeySet.iterator().next()));` -- 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...@geode.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org