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 a312337
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Fix registration and initialization of multiple extensions ([10256](https://github.com/opensearch-project/OpenSearch/pull/10256))
- Fix Segment Replication ShardLockObtainFailedException bug during index corruption ([10370](https://github.com/opensearch-project/OpenSearch/pull/10370))
- Fix some test methods in SimulatePipelineRequestParsingTests never run and fix test failure ([#10496](https://github.com/opensearch-project/OpenSearch/pull/10496))
- Fix flaky query profile phase tests with concurrent search enabled ([#10547](https://github.com/opensearch-project/OpenSearch/pull/10547))

### Security

[Unreleased 3.0]: https://github.com/opensearch-project/OpenSearch/compare/2.x...HEAD
[Unreleased 2.x]: https://github.com/opensearch-project/OpenSearch/compare/2.11...2.x
[Unreleased 2.x]: https://github.com/opensearch-project/OpenSearch/compare/2.11...2.x
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 a312337

Please sign in to comment.