mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
[TEST] DisabledFieldDataFormatTests assumes a single replica.
This commit is contained in:
parent
d792d14926
commit
0631b6a042
@ -25,10 +25,16 @@ import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
import org.elasticsearch.search.aggregations.AggregationBuilders;
|
||||
import org.elasticsearch.test.ElasticsearchIntegrationTest;
|
||||
|
||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFailures;
|
||||
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
|
||||
|
||||
public class DisabledFieldDataFormatTests extends ElasticsearchIntegrationTest {
|
||||
|
||||
@Override
|
||||
protected int numberOfReplicas() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void test() throws Exception {
|
||||
createIndex("test");
|
||||
ensureGreen();
|
||||
@ -45,7 +51,7 @@ public class DisabledFieldDataFormatTests extends ElasticsearchIntegrationTest {
|
||||
// try to run something that relies on field data and make sure that it fails
|
||||
try {
|
||||
resp = client().prepareSearch("test").addAggregation(AggregationBuilders.terms("t").field("s")).execute().actionGet();
|
||||
assertTrue(resp.toString(), resp.getFailedShards() > 0);
|
||||
assertFailures(resp);
|
||||
} catch (SearchPhaseExecutionException e) {
|
||||
// expected
|
||||
}
|
||||
@ -69,7 +75,7 @@ public class DisabledFieldDataFormatTests extends ElasticsearchIntegrationTest {
|
||||
refresh();
|
||||
try {
|
||||
resp = client().prepareSearch("test").addAggregation(AggregationBuilders.terms("t").field("s")).execute().actionGet();
|
||||
assertTrue(resp.toString(), resp.getFailedShards() > 0);
|
||||
assertFailures(resp);
|
||||
} catch (SearchPhaseExecutionException e) {
|
||||
// expected
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user