Skip to content

Commit aaf815a

Browse files
committed
update code
1 parent e2c36f8 commit aaf815a

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ tests:
6161
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
6262
method: test {p0=transform/transforms_start_stop/Verify start transform reuses destination index}
6363
issue: https://github.com/elastic/elasticsearch/issues/115808
64-
- class: org.elasticsearch.search.StressSearchServiceReaperIT
65-
method: testStressReaper
66-
issue: https://github.com/elastic/elasticsearch/issues/115816
6764
- class: org.elasticsearch.xpack.application.connector.ConnectorIndexServiceTests
6865
issue: https://github.com/elastic/elasticsearch/issues/116087
6966
- class: org.elasticsearch.xpack.test.rest.XPackRestIT

server/src/internalClusterTest/java/org/elasticsearch/search/StressSearchServiceReaperIT.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
import org.apache.lucene.tests.util.English;
1212
import org.elasticsearch.action.index.IndexRequestBuilder;
13+
import org.elasticsearch.action.search.SearchRequestBuilder;
14+
import org.elasticsearch.action.search.SearchResponse;
1315
import org.elasticsearch.common.settings.Settings;
1416
import org.elasticsearch.core.TimeValue;
1517
import org.elasticsearch.test.ESIntegTestCase;
@@ -33,7 +35,6 @@ protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
3335
.build();
3436
}
3537

36-
// see issue #5165 - this test fails each time without the fix in pull #5170
3738
public void testStressReaper() throws ExecutionException, InterruptedException {
3839
int num = randomIntBetween(100, 150);
3940
IndexRequestBuilder[] builders = new IndexRequestBuilder[num];
@@ -44,7 +45,16 @@ public void testStressReaper() throws ExecutionException, InterruptedException {
4445
indexRandom(true, builders);
4546
final int iterations = scaledRandomIntBetween(500, 1000);
4647
for (int i = 0; i < iterations; i++) {
47-
assertHitCountAndNoFailures(prepareSearch("test").setQuery(matchAllQuery()).setSize(num), num);
48+
SearchResponse response = null;
49+
try {
50+
SearchRequestBuilder searchRequestBuilder = prepareSearch("test").setQuery(matchAllQuery()).setSize(num);
51+
response = searchRequestBuilder.get();
52+
assertHitCountAndNoFailures(searchRequestBuilder, num);
53+
} finally {
54+
if(response != null) {
55+
response.decRef();
56+
}
57+
}
4858
}
4959
}
5060
}

0 commit comments

Comments
 (0)