Fix tests that use write consistency level in favor of ActiveShardCount
Original commit: elastic/x-pack-elasticsearch@4c463c8d7b
This commit is contained in:
parent
8368528e82
commit
287f4da0b9
|
@ -5,9 +5,9 @@
|
||||||
*/
|
*/
|
||||||
package org.elasticsearch.xpack.watcher.test.integration;
|
package org.elasticsearch.xpack.watcher.test.integration;
|
||||||
|
|
||||||
import org.elasticsearch.action.WriteConsistencyLevel;
|
|
||||||
import org.elasticsearch.action.search.SearchRequest;
|
import org.elasticsearch.action.search.SearchRequest;
|
||||||
import org.elasticsearch.action.search.SearchResponse;
|
import org.elasticsearch.action.search.SearchResponse;
|
||||||
|
import org.elasticsearch.action.support.ActiveShardCount;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.common.xcontent.XContentType;
|
import org.elasticsearch.common.xcontent.XContentType;
|
||||||
import org.elasticsearch.test.junit.annotations.TestLogging;
|
import org.elasticsearch.test.junit.annotations.TestLogging;
|
||||||
|
@ -140,7 +140,7 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase {
|
||||||
.startObject("none").endObject()
|
.startObject("none").endObject()
|
||||||
.endObject()
|
.endObject()
|
||||||
.endObject())
|
.endObject())
|
||||||
.setConsistencyLevel(WriteConsistencyLevel.ALL)
|
.setWaitForActiveShards(ActiveShardCount.ALL)
|
||||||
.setRefreshPolicy(IMMEDIATE)
|
.setRefreshPolicy(IMMEDIATE)
|
||||||
.get();
|
.get();
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase {
|
||||||
.startObject("none").endObject()
|
.startObject("none").endObject()
|
||||||
.endObject()
|
.endObject()
|
||||||
.endObject())
|
.endObject())
|
||||||
.setConsistencyLevel(WriteConsistencyLevel.ALL)
|
.setWaitForActiveShards(ActiveShardCount.ALL)
|
||||||
.setRefreshPolicy(IMMEDIATE)
|
.setRefreshPolicy(IMMEDIATE)
|
||||||
.get();
|
.get();
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase {
|
||||||
.startObject("none").endObject()
|
.startObject("none").endObject()
|
||||||
.endObject()
|
.endObject()
|
||||||
.endObject())
|
.endObject())
|
||||||
.setConsistencyLevel(WriteConsistencyLevel.ALL)
|
.setWaitForActiveShards(ActiveShardCount.ALL)
|
||||||
.setRefreshPolicy(IMMEDIATE)
|
.setRefreshPolicy(IMMEDIATE)
|
||||||
.get();
|
.get();
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase {
|
||||||
.field(event.type(), event)
|
.field(event.type(), event)
|
||||||
.endObject()
|
.endObject()
|
||||||
.endObject())
|
.endObject())
|
||||||
.setConsistencyLevel(WriteConsistencyLevel.ALL)
|
.setWaitForActiveShards(ActiveShardCount.ALL)
|
||||||
.setRefreshPolicy(IMMEDIATE)
|
.setRefreshPolicy(IMMEDIATE)
|
||||||
.get();
|
.get();
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase {
|
||||||
.condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1L))
|
.condition(compareCondition("ctx.payload.hits.total", CompareCondition.Op.EQ, 1L))
|
||||||
.buildAsBytes(XContentType.JSON)
|
.buildAsBytes(XContentType.JSON)
|
||||||
)
|
)
|
||||||
.setConsistencyLevel(WriteConsistencyLevel.ALL)
|
.setWaitForActiveShards(ActiveShardCount.ALL)
|
||||||
.get();
|
.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,7 +269,7 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase {
|
||||||
TriggeredWatch triggeredWatch = new TriggeredWatch(wid, event);
|
TriggeredWatch triggeredWatch = new TriggeredWatch(wid, event);
|
||||||
client().prepareIndex(TriggeredWatchStore.INDEX_NAME, TriggeredWatchStore.DOC_TYPE, triggeredWatch.id().value())
|
client().prepareIndex(TriggeredWatchStore.INDEX_NAME, TriggeredWatchStore.DOC_TYPE, triggeredWatch.id().value())
|
||||||
.setSource(jsonBuilder().value(triggeredWatch))
|
.setSource(jsonBuilder().value(triggeredWatch))
|
||||||
.setConsistencyLevel(WriteConsistencyLevel.ALL)
|
.setWaitForActiveShards(ActiveShardCount.ALL)
|
||||||
.get();
|
.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -320,7 +320,7 @@ public class BootStrapTests extends AbstractWatcherIntegrationTestCase {
|
||||||
TriggeredWatch triggeredWatch = new TriggeredWatch(wid, event);
|
TriggeredWatch triggeredWatch = new TriggeredWatch(wid, event);
|
||||||
client().prepareIndex(TriggeredWatchStore.INDEX_NAME, TriggeredWatchStore.DOC_TYPE, triggeredWatch.id().value())
|
client().prepareIndex(TriggeredWatchStore.INDEX_NAME, TriggeredWatchStore.DOC_TYPE, triggeredWatch.id().value())
|
||||||
.setSource(jsonBuilder().value(triggeredWatch))
|
.setSource(jsonBuilder().value(triggeredWatch))
|
||||||
.setConsistencyLevel(WriteConsistencyLevel.ALL)
|
.setWaitForActiveShards(ActiveShardCount.ALL)
|
||||||
.get();
|
.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue