Skip to content

Commit

Permalink
[Bug] Wait for outstanding requests to complete (opensearch-project#1925
Browse files Browse the repository at this point in the history
)

Signed-off-by: Suraj Singh <[email protected]>
  • Loading branch information
dreamer-89 committed Jan 21, 2022
1 parent 5e2af8f commit 3d49672
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 3d49672

Please sign in to comment.