diff --git a/src/test/java/org/opensearch/plugin/insights/core/service/grouper/MinMaxQueryGrouperBySimilarityIT.java b/src/test/java/org/opensearch/plugin/insights/core/service/grouper/MinMaxQueryGrouperBySimilarityIT.java index ff585126..a33602a1 100644 --- a/src/test/java/org/opensearch/plugin/insights/core/service/grouper/MinMaxQueryGrouperBySimilarityIT.java +++ b/src/test/java/org/opensearch/plugin/insights/core/service/grouper/MinMaxQueryGrouperBySimilarityIT.java @@ -131,8 +131,8 @@ private void validateGroups(int... expectedGroupSizes) throws IOException, Inter Thread.sleep(QueryInsightsSettings.QUERY_RECORD_QUEUE_DRAIN_INTERVAL.millis()); List> topQueries = null; - // run ten times to make sure the records are drained to the top queries services - for (int i = 0; i < 10; i++) { + // run twenty times to make sure the records are drained to the top queries services + for (int i = 0; i < 20; i++) { // Parse the response to validate group structure Request request = new Request("GET", "/_insights/top_queries?type=latency"); Response response = client().performRequest(request); @@ -175,12 +175,12 @@ private void validateGroups(int... expectedGroupSizes) throws IOException, Inter return; } - if (i < 9) { + if (i < 19) { Thread.sleep(QueryInsightsSettings.QUERY_RECORD_QUEUE_DRAIN_INTERVAL.millis()); } } fail( - "Failed to validate groups after 10 attempts. Expected groups: " + "Failed to validate groups after 20 attempts. Expected groups: " + Arrays.toString(expectedGroupSizes) + ", but got: " + (topQueries != null ? topQueries.size() : "null")