[TEST] don't check shard operations counter in ExceptionRetryTests
This commit is contained in:
parent
f0c18eb704
commit
e97353e84a
|
@ -36,7 +36,8 @@ import org.elasticsearch.transport.*;
|
|||
import org.junit.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
|
@ -57,6 +58,12 @@ public class ExceptionRetryTests extends ElasticsearchIntegrationTest {
|
|||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void beforeIndexDeletion() {
|
||||
// a write operation might still be in flight when the test has finished
|
||||
// so we should not check the operation counter here
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests retry mechanism when indexing. If an exception occurs when indexing then the indexing request is tried again before finally failing.
|
||||
* If auto generated ids are used this must not lead to duplicate ids
|
||||
|
|
|
@ -1018,7 +1018,7 @@ public final class InternalTestCluster extends TestCluster {
|
|||
IndicesService indexServices = getInstance(IndicesService.class, nodeAndClient.name);
|
||||
for (IndexService indexService : indexServices) {
|
||||
for (IndexShard indexShard : indexService) {
|
||||
assertThat(indexShard.getOperationsCount(), anyOf(equalTo(1), equalTo(0)));
|
||||
assertThat("index shard counter on shard " + indexShard.shardId() + " on node " + nodeAndClient.name + " not 0 or 1 ", indexShard.getOperationsCount(), anyOf(equalTo(1), equalTo(0)));
|
||||
if (indexShard.getOperationsCount() == 0) {
|
||||
assertThat(indexShard.state(), equalTo(IndexShardState.CLOSED));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue