[TEST] CCSDuelIT to not check successful shards (#75062)

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
This commit is contained in:
Luca Cavanna 2021-07-07 17:32:14 +02:00 committed by GitHub
parent 49a57eed42
commit 623044ed70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,6 +10,7 @@ package org.elasticsearch.search;
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;
@ -74,6 +75,7 @@ import org.elasticsearch.search.suggest.phrase.PhraseSuggestionBuilder;
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;
@ -206,8 +208,7 @@ public class CCSDuelIT extends ESRestTestCase {
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) {