Parcourir la source

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

Britta Weber il y a 10 ans
Parent
commit
e97353e84a

+ 8 - 1
src/test/java/org/elasticsearch/index/store/ExceptionRetryTests.java

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

+ 1 - 1
src/test/java/org/elasticsearch/test/InternalTestCluster.java

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