fabriziofortino commented on code in PR #1217: URL: https://github.com/apache/jackrabbit-oak/pull/1217#discussion_r1397518096
########## oak-search/src/test/java/org/apache/jackrabbit/oak/plugins/index/FacetCommonTest.java: ########## @@ -173,18 +179,34 @@ public void statisticalFacets() throws Exception { createDataset(NUM_LEAF_NODES_FOR_LARGE_DATASET); - assertEventually(() -> assertEquals("Unexpected number of facets", actualAclLabelCount.size(), getFacets().size())); + assertEventually(() -> { + Map<String, Integer> facets = getFacets(); + assertEquals("Unexpected number of facets", actualAclLabelCount.size(), facets.size()); - for (Map.Entry<String, Integer> facet : actualAclLabelCount.entrySet()) { - String facetLabel = facet.getKey(); - assertEventually(() -> { - int facetCount = getFacets().get(facetLabel); - float ratio = ((float) facetCount) / facet.getValue(); - assertTrue("Facet count for label: " + facetLabel + " is outside of 10% margin of error. " + - "Expected: " + facet.getValue() + "; Got: " + facetCount + "; Ratio: " + ratio, - Math.abs(ratio - 1) < 0.1); - }); - } + for (Map.Entry<String, Integer> facet : actualAclLabelCount.entrySet()) { + String facetLabel = facet.getKey(); + assertEventually(() -> { + int facetCount = facets.get(facetLabel); + float ratio = ((float) facetCount) / facet.getValue(); + assertTrue("Facet count for label: " + facetLabel + " is outside of 10% margin of error. " + + "Expected: " + facet.getValue() + "; Got: " + facetCount + "; Ratio: " + ratio, + Math.abs(ratio - 1) < 0.1); Review Comment: not if the dataset and random sampling are the same. The index name changes were introduced for this reason. -- 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: dev-unsubscr...@jackrabbit.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org