Skip to content

Conversation

@atris
Copy link
Contributor

@atris atris commented Aug 8, 2025

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

@github-actions github-actions bot added enhancement Enhancement or improvement to existing feature or request feature New feature or request help wanted Extra attention is needed lucene Search Search query, autocomplete ...etc labels Aug 8, 2025
@atris
Copy link
Contributor Author

atris commented Aug 8, 2025

@owaiskazi19 @andrross Please review

@github-actions github-actions bot added >test-failure Test failure from CI, local build, etc. autocut labels Aug 8, 2025
@github-actions github-actions bot added the flaky-test Random test failure that succeeds on second run label Aug 8, 2025
Copy link
Member

@sandeshkr419 sandeshkr419 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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>
@atris atris force-pushed the fix_existsquetes branch from 46e001b to e53fa38 Compare August 8, 2025 19:57
@atris
Copy link
Contributor Author

atris commented Aug 8, 2025

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.

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>
Copy link
Contributor

@jainankitk jainankitk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @atris for fixing this flaky test!

@sandeshkr419 sandeshkr419 removed lucene Search Search query, autocomplete ...etc help wanted Extra attention is needed feature New feature or request enhancement Enhancement or improvement to existing feature or request autocut >test-failure Test failure from CI, local build, etc. labels Aug 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2025

✅ Gradle check result for befa977: SUCCESS

@codecov
Copy link

codecov bot commented Aug 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.88%. Comparing base (696ed65) to head (befa977).
⚠️ Report is 14 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@atris
Copy link
Contributor Author

atris commented Aug 9, 2025

Thank you for reviewing. @andrross @jainankitk @sandeshkr419

If it looks good, can we please merge?

@rishabhmaurya rishabhmaurya merged commit 86ac3ab into opensearch-project:main Aug 11, 2025
38 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 11, 2025
* 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>
jainankitk pushed a commit that referenced this pull request Aug 11, 2025
---------

(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>
RajatGupta02 pushed a commit to RajatGupta02/OpenSearch that referenced this pull request Aug 18, 2025
* 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>
atris added a commit to atris/OpenSearch that referenced this pull request Aug 28, 2025
* 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>
kh3ra pushed a commit to kh3ra/OpenSearch that referenced this pull request Sep 5, 2025
* 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>
vinaykpud pushed a commit to vinaykpud/OpenSearch that referenced this pull request Sep 26, 2025
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.19 flaky-test Random test failure that succeeds on second run skip-changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AUTOCUT] Gradle Check Flaky Test Report for ExistsQueryBuilderTests

5 participants