Fix flaky ExistsQueryBuilderTests.testToQuery#18995
Fix flaky ExistsQueryBuilderTests.testToQuery#18995rishabhmaurya merged 2 commits intoopensearch-project:mainfrom
Conversation
|
@owaiskazi19 @andrross Please review |
There was a problem hiding this comment.
Thanks @atris for taking time to fix this flaky test.
I have a few comments to refine it more.
Also. if this was reproduce-able, can you please verify the same (before/after) by running the test in your IDE n-times.
server/src/test/java/org/opensearch/index/query/ExistsQueryBuilderTests.java
Show resolved
Hide resolved
server/src/test/java/org/opensearch/index/query/ExistsQueryBuilderTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/opensearch/index/query/ExistsQueryBuilderTests.java
Outdated
Show resolved
Hide resolved
Test was generating field patterns that matched raw.derived_keyword, which doesnt support exists queries. Fixed by replacing problematic patterns with TEXT_FIELD_NAME. Fixes opensearch-project#18724 Signed-off-by: Atri Sharma <atri.jiit@gmail.com>
Thanks for the review @sandeshkr419. I've addressed all your comments - removed the redundant check, moved the pattern check before wildcard logic, and preserved the original 25% probability for wildcards. I ran the test 30+ times locally with random seeds including the two failing seeds from the issue (8C4D6928119E4426 and D373738A924E04A). All pass now. Before the fix, these seeds failed with the UnsupportedOperationException. |
Signed-off-by: Atri Sharma <atri.jiit@gmail.com>
jainankitk
left a comment
There was a problem hiding this comment.
Thanks @atris for fixing this flaky test!
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #18995 +/- ##
============================================
- Coverage 72.88% 72.88% -0.01%
- Complexity 69300 69323 +23
============================================
Files 5642 5642
Lines 318640 318641 +1
Branches 46108 46108
============================================
- Hits 232237 232235 -2
- Misses 67566 67591 +25
+ Partials 18837 18815 -22 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thank you for reviewing. @andrross @jainankitk @sandeshkr419 If it looks good, can we please merge? |
* Fix flaky ExistsQueryBuilderTests.testToQuery Test was generating field patterns that matched raw.derived_keyword, which doesnt support exists queries. Fixed by replacing problematic patterns with TEXT_FIELD_NAME. Fixes #18724 Signed-off-by: Atri Sharma <atri.jiit@gmail.com> * Revert CHANGELOG changes Signed-off-by: Atri Sharma <atri.jiit@gmail.com> --------- Signed-off-by: Atri Sharma <atri.jiit@gmail.com> (cherry picked from commit 86ac3ab) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
--------- (cherry picked from commit 86ac3ab) Signed-off-by: Atri Sharma <atri.jiit@gmail.com> 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>
* Fix flaky ExistsQueryBuilderTests.testToQuery Test was generating field patterns that matched raw.derived_keyword, which doesnt support exists queries. Fixed by replacing problematic patterns with TEXT_FIELD_NAME. Fixes opensearch-project#18724 Signed-off-by: Atri Sharma <atri.jiit@gmail.com> * Revert CHANGELOG changes Signed-off-by: Atri Sharma <atri.jiit@gmail.com> --------- Signed-off-by: Atri Sharma <atri.jiit@gmail.com>
* Fix flaky ExistsQueryBuilderTests.testToQuery Test was generating field patterns that matched raw.derived_keyword, which doesnt support exists queries. Fixed by replacing problematic patterns with TEXT_FIELD_NAME. Fixes opensearch-project#18724 Signed-off-by: Atri Sharma <atri.jiit@gmail.com> * Revert CHANGELOG changes Signed-off-by: Atri Sharma <atri.jiit@gmail.com> --------- Signed-off-by: Atri Sharma <atri.jiit@gmail.com>
* Fix flaky ExistsQueryBuilderTests.testToQuery Test was generating field patterns that matched raw.derived_keyword, which doesnt support exists queries. Fixed by replacing problematic patterns with TEXT_FIELD_NAME. Fixes opensearch-project#18724 Signed-off-by: Atri Sharma <atri.jiit@gmail.com> * Revert CHANGELOG changes Signed-off-by: Atri Sharma <atri.jiit@gmail.com> --------- Signed-off-by: Atri Sharma <atri.jiit@gmail.com>
* Fix flaky ExistsQueryBuilderTests.testToQuery Test was generating field patterns that matched raw.derived_keyword, which doesnt support exists queries. Fixed by replacing problematic patterns with TEXT_FIELD_NAME. Fixes opensearch-project#18724 Signed-off-by: Atri Sharma <atri.jiit@gmail.com> * Revert CHANGELOG changes Signed-off-by: Atri Sharma <atri.jiit@gmail.com> --------- Signed-off-by: Atri Sharma <atri.jiit@gmail.com>
Test was generating field patterns that matched raw.derived_keyword, which doesnt support exists queries. Fixed by replacing problematic patterns with TEXT_FIELD_NAME.
Fixes #18274