Skip to content

Commit de63b2b

Browse files
committed
Update test
1 parent dbc043f commit de63b2b

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,6 @@ tests:
272272
- class: org.elasticsearch.search.CCSDuelIT
273273
method: testTerminateAfter
274274
issue: https://github.com/elastic/elasticsearch/issues/126085
275-
- class: org.elasticsearch.search.basic.SearchWithRandomDisconnectsIT
276-
method: testSearchWithRandomDisconnects
277-
issue: https://github.com/elastic/elasticsearch/issues/122707
278275
- class: org.elasticsearch.packaging.test.DockerTests
279276
method: test020PluginsListWithNoPlugins
280277
issue: https://github.com/elastic/elasticsearch/issues/126232

server/src/internalClusterTest/java/org/elasticsearch/search/basic/SearchWithRandomDisconnectsIT.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
*/
99
package org.elasticsearch.search.basic;
1010

11+
import com.carrotsearch.randomizedtesting.annotations.Repeat;
12+
1113
import org.apache.lucene.tests.util.LuceneTestCase;
1214
import org.elasticsearch.action.ActionListener;
1315
import org.elasticsearch.action.bulk.BulkRequestBuilder;
@@ -20,6 +22,7 @@
2022
import org.elasticsearch.index.IndexModule;
2123
import org.elasticsearch.index.IndexSettings;
2224
import org.elasticsearch.index.query.MatchAllQueryBuilder;
25+
import org.elasticsearch.test.ESIntegTestCase;
2326
import org.elasticsearch.test.disruption.NetworkDisruption;
2427

2528
import java.util.ArrayList;
@@ -31,6 +34,7 @@
3134
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
3235

3336
@LuceneTestCase.SuppressFileSystems(value = "HandleLimitFS") // we sometimes have >2048 open files
37+
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.SUITE)
3438
public class SearchWithRandomDisconnectsIT extends AbstractDisruptionTestCase {
3539

3640
public void testSearchWithRandomDisconnects() throws InterruptedException, ExecutionException {
@@ -82,14 +86,21 @@ private void runMoreSearches() {
8286
}
8387
});
8488
}
85-
for (int i = 0, n = randomIntBetween(50, 100); i < n; i++) {
89+
for (int i = 0, n = randomIntBetween(5, 10); i < n; i++) {
8690
NetworkDisruption networkDisruption = new NetworkDisruption(
8791
isolateNode(internalCluster().getRandomNodeName()),
8892
NetworkDisruption.DISCONNECT
8993
);
9094
setDisruptionScheme(networkDisruption);
9195
networkDisruption.startDisrupting();
9296
networkDisruption.stopDisrupting();
97+
98+
try {
99+
Thread.sleep(300);
100+
} catch (InterruptedException e) {
101+
Thread.currentThread().interrupt();
102+
}
103+
93104
internalCluster().clearDisruptionScheme();
94105
ensureFullyConnectedCluster();
95106
}
@@ -103,7 +114,7 @@ private void runMoreSearches() {
103114

104115
private static SearchRequestBuilder prepareRandomSearch() {
105116
return prepareSearch("*").setQuery(new MatchAllQueryBuilder())
106-
.setSize(9999)
117+
.setSize(randomIntBetween(10,100))
107118
.setFetchSource(true)
108119
.setAllowPartialSearchResults(randomBoolean());
109120
}

0 commit comments

Comments
 (0)