diff --git a/src/test/java/org/opensearch/search/asynchronous/integTests/AsynchronousSearchStatsIT.java b/src/test/java/org/opensearch/search/asynchronous/integTests/AsynchronousSearchStatsIT.java index e74152d..5abfda2 100644 --- a/src/test/java/org/opensearch/search/asynchronous/integTests/AsynchronousSearchStatsIT.java +++ b/src/test/java/org/opensearch/search/asynchronous/integTests/AsynchronousSearchStatsIT.java @@ -171,9 +171,9 @@ public void testStatsAcrossNodes() throws InterruptedException, ExecutionExcepti AtomicLong actualNumFailures = new AtomicLong(); AtomicLong actualNumPersisted = new AtomicLong(); + waitForAsyncSearchTasksToComplete(); AsynchronousSearchStatsResponse statsResponse = client().execute(AsynchronousSearchStatsAction.INSTANCE, new AsynchronousSearchStatsRequest()).get(); - waitForAsyncSearchTasksToComplete(); for (AsynchronousSearchStats node : statsResponse.getNodes()) { AsynchronousSearchCountStats asCountStats = node.getAsynchronousSearchCountStats();