[TEST] don't check shard operations counter in ExceptionRetryTests

This commit is contained in:
Britta Weber 2015-05-26 08:56:33 +02:00
parent f0c18eb704
commit e97353e84a
2 changed files with 9 additions and 2 deletions

View File

@ -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

View File

@ -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));
}