* Thanks to #39793 dynamic mapping updates don't contain blocking operations anymore so we don't have to manually put the mapping in this test and can keep it a little simpler
This commit is contained in:
parent
67820f9da1
commit
7824f60a34
|
@ -47,7 +47,6 @@ import org.elasticsearch.action.admin.indices.delete.DeleteIndexAction;
|
||||||
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
|
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
|
||||||
import org.elasticsearch.action.admin.indices.delete.TransportDeleteIndexAction;
|
import org.elasticsearch.action.admin.indices.delete.TransportDeleteIndexAction;
|
||||||
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingAction;
|
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingAction;
|
||||||
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest;
|
|
||||||
import org.elasticsearch.action.admin.indices.mapping.put.TransportPutMappingAction;
|
import org.elasticsearch.action.admin.indices.mapping.put.TransportPutMappingAction;
|
||||||
import org.elasticsearch.action.admin.indices.shards.IndicesShardStoresAction;
|
import org.elasticsearch.action.admin.indices.shards.IndicesShardStoresAction;
|
||||||
import org.elasticsearch.action.admin.indices.shards.TransportIndicesShardStoresAction;
|
import org.elasticsearch.action.admin.indices.shards.TransportIndicesShardStoresAction;
|
||||||
|
@ -260,29 +259,24 @@ public class SnapshotResiliencyTests extends ESTestCase {
|
||||||
)));
|
)));
|
||||||
}));
|
}));
|
||||||
final AtomicInteger countdown = new AtomicInteger(documents);
|
final AtomicInteger countdown = new AtomicInteger(documents);
|
||||||
masterNode.client.admin().indices().putMapping(
|
for (int i = 0; i < documents; ++i) {
|
||||||
new PutMappingRequest(index).type("_doc").source("foo", "type=text"),
|
masterNode.client.bulk(
|
||||||
assertNoFailureListener(r -> {
|
new BulkRequest().add(new IndexRequest(index).source(
|
||||||
for (int i = 0; i < documents; ++i) {
|
Collections.singletonMap("foo", "bar" + i)))
|
||||||
masterNode.client.bulk(
|
.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE),
|
||||||
new BulkRequest().add(new IndexRequest(index).source(
|
assertNoFailureListener(
|
||||||
Collections.singletonMap("foo", "bar" + i)))
|
bulkResponse -> {
|
||||||
.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE),
|
assertFalse(
|
||||||
assertNoFailureListener(
|
"Failures in bulkresponse: " + bulkResponse.buildFailureMessage(),
|
||||||
bulkResponse -> {
|
bulkResponse.hasFailures());
|
||||||
assertFalse(
|
if (countdown.decrementAndGet() == 0) {
|
||||||
"Failures in bulkresponse: " + bulkResponse.buildFailureMessage(),
|
afterIndexing.run();
|
||||||
bulkResponse.hasFailures());
|
}
|
||||||
if (countdown.decrementAndGet() == 0) {
|
}));
|
||||||
afterIndexing.run();
|
}
|
||||||
}
|
if (documents == 0) {
|
||||||
}));
|
afterIndexing.run();
|
||||||
}
|
}
|
||||||
if (documents == 0) {
|
|
||||||
afterIndexing.run();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
));
|
|
||||||
}))));
|
}))));
|
||||||
runUntil(documentCountVerified::get, TimeUnit.MINUTES.toMillis(5L));
|
runUntil(documentCountVerified::get, TimeUnit.MINUTES.toMillis(5L));
|
||||||
assertTrue(createdSnapshot.get());
|
assertTrue(createdSnapshot.get());
|
||||||
|
|
Loading…
Reference in New Issue