Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed flaky and failing test cases for concurrent search #11183

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ private void testSearchAndRelocateConcurrently(final int numberOfReplicas) throw
)
);
}
indexRandomForConcurrentSearch("test");
indexRandom(true, indexBuilders.toArray(new IndexRequestBuilder[0]));
assertHitCount(client().prepareSearch().get(), (numDocs));
final int numIters = scaledRandomIntBetween(5, 20);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ public void testDfsQueryThenFetch() throws Exception {
index(Integer.toString(i - 1048), "test", i);
}
refresh();
indexRandomForConcurrentSearch("test");

int total = 0;
SearchResponse searchResponse = client().prepareSearch("test")
Expand Down Expand Up @@ -206,6 +207,7 @@ public void testDfsQueryThenFetch() throws Exception {

public void testDfsQueryThenFetchWithSort() throws Exception {
prepareData();
indexRandomForConcurrentSearch("test");

int total = 0;
SearchResponse searchResponse = client().prepareSearch("test")
Expand Down Expand Up @@ -244,6 +246,7 @@ public void testDfsQueryThenFetchWithSort() throws Exception {

public void testQueryThenFetch() throws Exception {
prepareData();
indexRandomForConcurrentSearch("test");

int total = 0;
SearchResponse searchResponse = client().prepareSearch("test")
Expand Down Expand Up @@ -275,6 +278,7 @@ public void testQueryThenFetch() throws Exception {

public void testQueryThenFetchWithFrom() throws Exception {
Set<String> fullExpectedIds = prepareData();
indexRandomForConcurrentSearch("test");

SearchSourceBuilder source = searchSource().query(matchAllQuery()).explain(true);

Expand Down Expand Up @@ -302,6 +306,7 @@ public void testQueryThenFetchWithFrom() throws Exception {

public void testQueryThenFetchWithSort() throws Exception {
prepareData();
indexRandomForConcurrentSearch("test");

int total = 0;
SearchResponse searchResponse = client().prepareSearch("test")
Expand Down Expand Up @@ -332,6 +337,7 @@ public void testQueryThenFetchWithSort() throws Exception {

public void testSimpleFacets() throws Exception {
prepareData();
indexRandomForConcurrentSearch("test");

SearchSourceBuilder sourceBuilder = searchSource().query(termQuery("multi", "test"))
.from(0)
Expand Down Expand Up @@ -374,6 +380,7 @@ public void testFailedSearchWithWrongQuery() throws Exception {

public void testFailedSearchWithWrongFrom() throws Exception {
prepareData();
indexRandomForConcurrentSearch("test");

NumShards test = getNumShards("test");

Expand Down Expand Up @@ -402,6 +409,7 @@ public void testFailedSearchWithWrongFrom() throws Exception {

public void testFailedMultiSearchWithWrongQuery() throws Exception {
prepareData();
indexRandomForConcurrentSearch("test");

logger.info("Start Testing failed multi search with a wrong query");

Expand All @@ -424,6 +432,7 @@ public void testFailedMultiSearchWithWrongQuery() throws Exception {

public void testFailedMultiSearchWithWrongQueryWithFunctionScore() throws Exception {
prepareData();
indexRandomForConcurrentSearch("test");

logger.info("Start Testing failed multi search with a wrong query");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ protected Collection<Class<? extends Plugin>> nodePlugins() {

@SuppressWarnings("unchecked")
public void testPlugin() throws Exception {
assumeFalse(
"Concurrent search case muted pending fix: https://github.com/opensearch-project/OpenSearch/issues/11112",
internalCluster().clusterService().getClusterSettings().get(CLUSTER_CONCURRENT_SEGMENT_SEARCH_SETTING)
);
client().admin()
.indices()
.prepareCreate("test")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ public void testConsistentHitsWithSameSeed() throws Exception {
}
flush();
refresh();
indexRandomForConcurrentSearch("test");
int outerIters = scaledRandomIntBetween(10, 20);
for (int o = 0; o < outerIters; o++) {
final int seed = randomInt();
Expand Down Expand Up @@ -299,6 +300,7 @@ public void testSeedReportedInExplain() throws Exception {
index("test", "type", "1", jsonBuilder().startObject().endObject());
flush();
refresh();
indexRandomForConcurrentSearch("test");

int seed = 12345678;

Expand All @@ -318,6 +320,7 @@ public void testSeedAndNameReportedInExplain() throws Exception {
index("test", "type", "1", jsonBuilder().startObject().endObject());
flush();
refresh();
indexRandomForConcurrentSearch("test");

int seed = 12345678;

Expand Down
Loading