Skip to content

Commit

Permalink
Fix flaky testPostFilterDisablesCountOptimization with concurrent sea…
Browse files Browse the repository at this point in the history
…rch enabled (#11674) (#11682)

(cherry picked from commit 316b60a)

Signed-off-by: Ticheng Lin <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 4e35452 commit 56eb55d
Showing 1 changed file with 32 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1413,12 +1413,22 @@ public void testCollapseQuerySearchResults() throws Exception {
assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L));
assertThat(query.getTimeBreakdown().get("score_count"), greaterThanOrEqualTo(6L));
if (executor != null) {
assertThat(query.getTimeBreakdown().get("max_score"), greaterThan(0L));
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(2L));
assertThat(query.getTimeBreakdown().get("avg_score_count"), greaterThanOrEqualTo(6L));
long maxScore = query.getTimeBreakdown().get("max_score");
long minScore = query.getTimeBreakdown().get("min_score");
long avgScore = query.getTimeBreakdown().get("avg_score");
long maxScoreCount = query.getTimeBreakdown().get("max_score_count");
long minScoreCount = query.getTimeBreakdown().get("min_score_count");
long avgScoreCount = query.getTimeBreakdown().get("avg_score_count");
assertThat(maxScore, greaterThan(0L));
assertThat(minScore, greaterThan(0L));
assertThat(avgScore, greaterThan(0L));
assertThat(maxScore, greaterThanOrEqualTo(avgScore));
assertThat(avgScore, greaterThanOrEqualTo(minScore));
assertThat(maxScoreCount, greaterThan(0L));
assertThat(minScoreCount, greaterThan(0L));
assertThat(avgScoreCount, greaterThan(0L));
assertThat(maxScoreCount, greaterThanOrEqualTo(avgScoreCount));
assertThat(avgScoreCount, greaterThanOrEqualTo(minScoreCount));
}
assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L));
assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L));
Expand Down Expand Up @@ -1448,12 +1458,22 @@ public void testCollapseQuerySearchResults() throws Exception {
assertThat(query.getTimeBreakdown().get("score"), greaterThan(0L));
assertThat(query.getTimeBreakdown().get("score_count"), greaterThanOrEqualTo(6L));
if (executor != null) {
assertThat(query.getTimeBreakdown().get("max_score"), greaterThan(0L));
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(2L));
assertThat(query.getTimeBreakdown().get("avg_score_count"), greaterThanOrEqualTo(6L));
long maxScore = query.getTimeBreakdown().get("max_score");
long minScore = query.getTimeBreakdown().get("min_score");
long avgScore = query.getTimeBreakdown().get("avg_score");
long maxScoreCount = query.getTimeBreakdown().get("max_score_count");
long minScoreCount = query.getTimeBreakdown().get("min_score_count");
long avgScoreCount = query.getTimeBreakdown().get("avg_score_count");
assertThat(maxScore, greaterThan(0L));
assertThat(minScore, greaterThan(0L));
assertThat(avgScore, greaterThan(0L));
assertThat(maxScore, greaterThanOrEqualTo(avgScore));
assertThat(avgScore, greaterThanOrEqualTo(minScore));
assertThat(maxScoreCount, greaterThan(0L));
assertThat(minScoreCount, greaterThan(0L));
assertThat(avgScoreCount, greaterThan(0L));
assertThat(maxScoreCount, greaterThanOrEqualTo(avgScoreCount));
assertThat(avgScoreCount, greaterThanOrEqualTo(minScoreCount));
}
assertThat(query.getTimeBreakdown().get("create_weight"), greaterThan(0L));
assertThat(query.getTimeBreakdown().get("create_weight_count"), equalTo(1L));
Expand Down

0 comments on commit 56eb55d

Please sign in to comment.