Skip to content

Commit f9198d2

Browse files
sef
1 parent ac5a544 commit f9198d2

File tree

1 file changed

+0
-79
lines changed

1 file changed

+0
-79
lines changed

server/src/internalClusterTest/java/org/elasticsearch/action/search/TransportSearchIT.java

-79
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.elasticsearch.action.index.IndexRequest;
2121
import org.elasticsearch.action.support.IndicesOptions;
2222
import org.elasticsearch.action.support.WriteRequest;
23-
import org.elasticsearch.client.internal.Client;
2423
import org.elasticsearch.cluster.metadata.IndexMetadata;
2524
import org.elasticsearch.common.Strings;
2625
import org.elasticsearch.common.breaker.CircuitBreaker;
@@ -445,84 +444,6 @@ public void testSearchIdle() throws Exception {
445444
);
446445
}
447446

448-
public void testCircuitBreakerReduceFail() throws Exception {
449-
int numShards = randomIntBetween(1, 10);
450-
indexSomeDocs("test", numShards, numShards * 3);
451-
452-
{
453-
final AtomicArray<Boolean> responses = new AtomicArray<>(10);
454-
final CountDownLatch latch = new CountDownLatch(10);
455-
for (int i = 0; i < 10; i++) {
456-
int batchReduceSize = randomIntBetween(2, Math.max(numShards + 1, 3));
457-
SearchRequest request = prepareSearch("test").addAggregation(new TestAggregationBuilder("test"))
458-
.setBatchedReduceSize(batchReduceSize)
459-
.request();
460-
final int index = i;
461-
client().search(request, new ActionListener<>() {
462-
@Override
463-
public void onResponse(SearchResponse response) {
464-
responses.set(index, true);
465-
latch.countDown();
466-
}
467-
468-
@Override
469-
public void onFailure(Exception e) {
470-
responses.set(index, false);
471-
latch.countDown();
472-
}
473-
});
474-
}
475-
latch.await();
476-
assertThat(responses.asList().size(), equalTo(10));
477-
for (boolean resp : responses.asList()) {
478-
assertTrue(resp);
479-
}
480-
assertBusy(() -> assertThat(requestBreakerUsed(), equalTo(0L)));
481-
}
482-
483-
try {
484-
updateClusterSettings(Settings.builder().put("indices.breaker.request.limit", "1b"));
485-
final Client client = client();
486-
assertBusy(() -> {
487-
Exception exc = expectThrows(
488-
Exception.class,
489-
client.prepareSearch("test").addAggregation(new TestAggregationBuilder("test"))
490-
);
491-
assertThat(exc.getCause().getMessage(), containsString("<reduce_aggs>"));
492-
});
493-
494-
final AtomicArray<Exception> exceptions = new AtomicArray<>(10);
495-
final CountDownLatch latch = new CountDownLatch(10);
496-
for (int i = 0; i < 10; i++) {
497-
int batchReduceSize = randomIntBetween(2, Math.max(numShards + 1, 3));
498-
SearchRequest request = prepareSearch("test").addAggregation(new TestAggregationBuilder("test"))
499-
.setBatchedReduceSize(batchReduceSize)
500-
.request();
501-
final int index = i;
502-
client().search(request, new ActionListener<>() {
503-
@Override
504-
public void onResponse(SearchResponse response) {
505-
latch.countDown();
506-
}
507-
508-
@Override
509-
public void onFailure(Exception exc) {
510-
exceptions.set(index, exc);
511-
latch.countDown();
512-
}
513-
});
514-
}
515-
latch.await();
516-
assertThat(exceptions.asList().size(), equalTo(10));
517-
for (Exception exc : exceptions.asList()) {
518-
assertThat(exc.getCause().getMessage(), containsString("<reduce_aggs>"));
519-
}
520-
assertBusy(() -> assertThat(requestBreakerUsed(), equalTo(0L)));
521-
} finally {
522-
updateClusterSettings(Settings.builder().putNull("indices.breaker.request.limit"));
523-
}
524-
}
525-
526447
public void testCircuitBreakerFetchFail() throws Exception {
527448
int numShards = randomIntBetween(1, 10);
528449
int numDocs = numShards * 10;

0 commit comments

Comments
 (0)