Skip to content

Commit

Permalink
Fix flaky test SegmentReplicationIT.testDeleteOperations. (#9244)
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Handalian <[email protected]>
  • Loading branch information
mch2 authored Aug 11, 2023
1 parent 4b21849 commit ab08d73
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ public void testDeleteOperations() throws Exception {

createIndex(INDEX_NAME);
ensureGreen(INDEX_NAME);
final int initialDocCount = scaledRandomIntBetween(0, 200);
final int initialDocCount = scaledRandomIntBetween(1, 20);
try (
BackgroundIndexer indexer = new BackgroundIndexer(
INDEX_NAME,
Expand All @@ -632,7 +632,7 @@ public void testDeleteOperations() throws Exception {
refresh(INDEX_NAME);
waitForSearchableDocs(initialDocCount, nodeA, nodeB);

final int additionalDocCount = scaledRandomIntBetween(0, 200);
final int additionalDocCount = scaledRandomIntBetween(0, 20);
final int expectedHitCount = initialDocCount + additionalDocCount;
indexer.start(additionalDocCount);
waitForDocs(expectedHitCount, indexer);
Expand All @@ -641,6 +641,7 @@ public void testDeleteOperations() throws Exception {
ensureGreen(INDEX_NAME);

Set<String> ids = indexer.getIds();
assertFalse(ids.isEmpty());
String id = ids.toArray()[0].toString();
client(nodeA).prepareDelete(INDEX_NAME, id).setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE).get();

Expand Down

0 comments on commit ab08d73

Please sign in to comment.