Skip to content

Commit

Permalink
Fix flaky query profile phase tests with concurrent search enabled (o…
Browse files Browse the repository at this point in the history
…pensearch-project#10547)

Signed-off-by: Ticheng Lin <[email protected]>
  • Loading branch information
ticheng-aws committed Oct 10, 2023
1 parent d3c8909 commit daa333a
Showing 1 changed file with 5 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1066,10 +1066,6 @@ public void testIndexSortScrollOptimization() throws Exception {
}

public void testDisableTopScoreCollection() throws Exception {
assumeFalse(
"Concurrent search case muted pending fix: https://github.com/opensearch-project/OpenSearch/issues/10469",
executor != null
);
Directory dir = newDirectory();
IndexWriterConfig iwc = newIndexWriterConfig(new StandardAnalyzer());
RandomIndexWriter w = new RandomIndexWriter(random(), dir, iwc);
Expand Down Expand Up @@ -1108,10 +1104,10 @@ public void testDisableTopScoreCollection() throws Exception {
assertThat(query.getTimeBreakdown().get("score_count"), greaterThan(0L));
if (executor != null) {
assertThat(query.getTimeBreakdown().get("max_score"), greaterThan(0L));
assertThat(query.getTimeBreakdown().get("min_score"), greaterThan(0L));
assertThat(query.getTimeBreakdown().get("min_score"), greaterThanOrEqualTo(0L));
assertThat(query.getTimeBreakdown().get("avg_score"), greaterThan(0L));
assertThat(query.getTimeBreakdown().get("max_score_count"), greaterThan(0L));
assertThat(query.getTimeBreakdown().get("min_score_count"), greaterThan(0L));
assertThat(query.getTimeBreakdown().get("min_score_count"), greaterThanOrEqualTo(0L));
assertThat(query.getTimeBreakdown().get("avg_score_count"), greaterThan(0L));
}
assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L));
Expand Down Expand Up @@ -1241,10 +1237,6 @@ public void testMinScore() throws Exception {
}

public void testMaxScore() throws Exception {
assumeFalse(
"Concurrent search case muted pending fix: https://github.com/opensearch-project/OpenSearch/issues/9932",
executor != null
);
Directory dir = newDirectory();
final Sort sort = new Sort(new SortField("filter", SortField.Type.STRING));
IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort);
Expand Down Expand Up @@ -1286,7 +1278,7 @@ public void testMaxScore() throws Exception {
assertThat(query.getTimeBreakdown().get("max_score"), greaterThan(0L));
assertThat(query.getTimeBreakdown().get("min_score"), greaterThanOrEqualTo(0L));
assertThat(query.getTimeBreakdown().get("avg_score"), greaterThan(0L));
assertThat(query.getTimeBreakdown().get("max_score_count"), greaterThanOrEqualTo(6L));
assertThat(query.getTimeBreakdown().get("max_score_count"), greaterThanOrEqualTo(4L));
assertThat(query.getTimeBreakdown().get("min_score_count"), greaterThanOrEqualTo(0L));
assertThat(query.getTimeBreakdown().get("avg_score_count"), greaterThanOrEqualTo(1L));
}
Expand Down Expand Up @@ -1364,10 +1356,6 @@ public void testMaxScore() throws Exception {
}

public void testCollapseQuerySearchResults() throws Exception {
assumeFalse(
"Concurrent search case muted pending fix: https://github.com/opensearch-project/OpenSearch/issues/10139",
executor != null
);
Directory dir = newDirectory();
final Sort sort = new Sort(new SortField("user", SortField.Type.INT));
IndexWriterConfig iwc = newIndexWriterConfig().setIndexSort(sort);
Expand Down Expand Up @@ -1412,7 +1400,7 @@ public void testCollapseQuerySearchResults() throws Exception {
assertThat(query.getTimeBreakdown().get("min_score"), greaterThan(0L));
assertThat(query.getTimeBreakdown().get("avg_score"), greaterThan(0L));
assertThat(query.getTimeBreakdown().get("max_score_count"), greaterThanOrEqualTo(6L));
assertThat(query.getTimeBreakdown().get("min_score_count"), greaterThanOrEqualTo(6L));
assertThat(query.getTimeBreakdown().get("min_score_count"), greaterThanOrEqualTo(2L));
assertThat(query.getTimeBreakdown().get("avg_score_count"), greaterThanOrEqualTo(6L));
}
assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L));
Expand Down Expand Up @@ -1447,7 +1435,7 @@ public void testCollapseQuerySearchResults() throws Exception {
assertThat(query.getTimeBreakdown().get("min_score"), greaterThan(0L));
assertThat(query.getTimeBreakdown().get("avg_score"), greaterThan(0L));
assertThat(query.getTimeBreakdown().get("max_score_count"), greaterThanOrEqualTo(6L));
assertThat(query.getTimeBreakdown().get("min_score_count"), greaterThanOrEqualTo(6L));
assertThat(query.getTimeBreakdown().get("min_score_count"), greaterThanOrEqualTo(2L));
assertThat(query.getTimeBreakdown().get("avg_score_count"), greaterThanOrEqualTo(6L));
}
assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L));
Expand Down

0 comments on commit daa333a

Please sign in to comment.