Skip to content

Commit

Permalink
Fix flaky testPostFilterDisablesCountOptimization with concurrent sea…
Browse files Browse the repository at this point in the history
…rch enabled

Signed-off-by: Ticheng Lin <[email protected]>
  • Loading branch information
ticheng-aws committed Dec 27, 2023
1 parent b9022c5 commit 5b65415
Showing 1 changed file with 32 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1401,12 +1401,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 @@ -1436,12 +1446,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 5b65415

Please sign in to comment.