From 3d49672349ffbb4c3b59c360083818b7877bbdb7 Mon Sep 17 00:00:00 2001 From: Suraj Singh <79435743+dreamer-89@users.noreply.github.com> Date: Tue, 18 Jan 2022 07:49:47 -0800 Subject: [PATCH] [Bug] Wait for outstanding requests to complete (#1925) Signed-off-by: Suraj Singh --- .../index/ShardIndexingPressureSettingsIT.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/src/internalClusterTest/java/org/opensearch/index/ShardIndexingPressureSettingsIT.java b/server/src/internalClusterTest/java/org/opensearch/index/ShardIndexingPressureSettingsIT.java index ea8749963aa63..bdd2b8562aa8f 100644 --- a/server/src/internalClusterTest/java/org/opensearch/index/ShardIndexingPressureSettingsIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/index/ShardIndexingPressureSettingsIT.java @@ -403,6 +403,15 @@ public void testShardIndexingPressureEnforcedEnabledDisabledSetting() throws Exc secondSuccessFuture = client(coordinatingOnlyNode).bulk(bulkRequest); Thread.sleep(25); + assertBusy( + () -> { + assertEquals( + coordinatingShardTracker.getCoordinatingOperationTracker().getPerformanceTracker().getTotalOutstandingRequests(), + 2 + ); + } + ); + // This request breaches the threshold and hence will be rejected expectThrows(OpenSearchRejectedExecutionException.class, () -> client(coordinatingOnlyNode).bulk(bulkRequest).actionGet());