Skip to content

Commit

Permalink
[Bug] Wait for outstanding requests to complete (#1925)
Browse files Browse the repository at this point in the history
Signed-off-by: Suraj Singh <[email protected]>
  • Loading branch information
dreamer-89 authored Jan 18, 2022
1 parent d3a4c47 commit 7691f07
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down

0 comments on commit 7691f07

Please sign in to comment.