Skip to content

Commit

Permalink
[TEST] CCSDuelIT to not check successful shards (#75062)
Browse files Browse the repository at this point in the history
CCSDuelIT sometimes fails due to an unexpected number of shards returned in the refresh response. We create an index with a certain number of shards and no replicas, and sometimes the number of shards refresh is higher by one than the shards we created. This is not symptom of a problem though, as we are checking that there are no failures, but rather indicates a relocation happening, during which both copies of the same shard have been refreshed.

Closes #61258
Closes #72637
Closes #67754
  • Loading branch information
javanna authored Jul 7, 2021
1 parent 49a57ee commit 623044e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import com.carrotsearch.randomizedtesting.RandomizedContext;
import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;

import org.apache.lucene.search.join.ScoreMode;
import org.apache.lucene.util.TimeUnits;
import org.elasticsearch.action.ActionListener;
Expand Down Expand Up @@ -74,6 +75,7 @@
import org.elasticsearch.search.suggest.term.TermSuggestion;
import org.elasticsearch.search.suggest.term.TermSuggestionBuilder;
import org.elasticsearch.test.NotEqualMessageBuilder;
import org.elasticsearch.test.hamcrest.ElasticsearchAssertions;
import org.elasticsearch.test.rest.ESRestTestCase;
import org.junit.AfterClass;
import org.junit.Before;
Expand Down Expand Up @@ -206,8 +208,7 @@ public void afterBulk(long executionId, BulkRequest request, Throwable failure)
assertTrue(bulkProcessor.awaitClose(30, TimeUnit.SECONDS));

RefreshResponse refreshResponse = restHighLevelClient.indices().refresh(new RefreshRequest(INDEX_NAME), RequestOptions.DEFAULT);
assertEquals(0, refreshResponse.getFailedShards());
assertEquals(numShards, refreshResponse.getSuccessfulShards());
ElasticsearchAssertions.assertNoFailures(refreshResponse);
}

private static IndexRequest buildIndexRequest(String id, String type, String questionId) {
Expand Down

0 comments on commit 623044e

Please sign in to comment.