Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Flaky SimpleQueryStringIT Tests #12575

Merged
merged 2 commits into from
Mar 21, 2024
Merged

Conversation

kkewwei
Copy link
Contributor

@kkewwei kkewwei commented Mar 10, 2024

Signed-off-by: kkewwei kkewwei@163.com

Description

org.opensearch.search.query.SimpleQueryStringIT.testDocWithAllTypes is flaky.

Related Issues

Resolves #12574

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • Public documentation issue/PR created

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link
Contributor

github-actions bot commented Mar 10, 2024

Compatibility status:

Checks if related components are compatible with change bb9d3d6

Incompatible components

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/flow-framework.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/performance-analyzer.git]

Copy link
Contributor

❕ Gradle check result for 02679f8: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.search.SearchWeightedRoutingIT.testMultiGetWithNetworkDisruption_FailOpenEnabled
      1 org.opensearch.indices.replication.SegmentReplicationTargetServiceTests.testShardAlreadyReplicating

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link

codecov bot commented Mar 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.39%. Comparing base (2b17902) to head (bb9d3d6).
Report is 70 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #12575      +/-   ##
============================================
- Coverage     71.43%   71.39%   -0.05%     
- Complexity    59960    59963       +3     
============================================
  Files          4984     4984              
  Lines        282247   282247              
  Branches      40952    40952              
============================================
- Hits         201617   201504     -113     
- Misses        63954    64057     +103     
- Partials      16676    16686      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

✅ Gradle check result for 99223d4: SUCCESS

@kkewwei
Copy link
Contributor Author

kkewwei commented Mar 11, 2024

@kkmr please see it again, it's still blocked.

@kotwanikunal
Copy link
Member

@kkewwei Can you please describe how the new values solve flakiness?

@kkewwei
Copy link
Contributor Author

kkewwei commented Mar 17, 2024

@kotwanikunal simpleQueryStringQuery("foo Bar 19 127.0.0.1")
https://github.com/opensearch-project/OpenSearch/blob/main/server/src/internalClusterTest/java/org/opensearch/search/query/SimpleQueryStringIT.java#L591
will be rewritted to BooleanQuery(TermQuery...), which the count of TermQuery will be bigger than CLUSTER_MAX_CLAUSE_COUNT= randomIntBetween(60, 100), and throw the exception:

Caused by: NotSerializableExceptionWrapper[too_many_nested_clauses: Query contains too many nested clauses; maxClauseCount is set to 60]
	at org.apache.lucene.search.IndexSearcher$1.visitLeaf(IndexSearcher.java:806)
	at org.apache.lucene.document.SortedNumericDocValuesRangeQuery.visit(SortedNumericDocValuesRangeQuery.java:67)
	at org.apache.lucene.search.IndexOrDocValuesQuery.visit(IndexOrDocValuesQuery.java:130)
	at org.apache.lucene.search.BooleanQuery.visit(BooleanQuery.java:616)
	at org.apache.lucene.search.BooleanQuery.visit(BooleanQuery.java:611)
	at org.apache.lucene.search.BooleanQuery.visit(BooleanQuery.java:611)
	at org.apache.lucene.search.IndexSearcher.rewrite(IndexSearcher.java:774)
	at org.opensearch.search.internal.ContextIndexSearcher.rewrite(ContextIndexSearcher.java:197)
	at org.opensearch.search.DefaultSearchContext.preProcess(DefaultSearchContext.java:358)
	at org.opensearch.search.query.QueryPhase.preProcess(QueryPhase.java:127)
	at org.opensearch.search.SearchService.createContext(SearchService.java:1010)
	at org.opensearch.search.SearchService.executeQueryPhase(SearchService.java:606)
	at org.opensearch.search.SearchService$2.lambda$onResponse$0(SearchService.java:579)

when CLUSTER_MAX_CLAUSE_COUNT=80, it work will.

@reta
Copy link
Collaborator

reta commented Mar 17, 2024

@kotwanikunal simpleQueryStringQuery("foo Bar 19 127.0.0.1")

@kkewwei could you please add the comment to the test (where random value is assigned) to explain lower bound selection? thank you

@github-actions github-actions bot added the flaky-test Random test failure that succeeds on second run label Mar 21, 2024
Signed-off-by: kkewwei <kkewwei@163.com>
Signed-off-by: kkewwei <kkewwei@163.com>
Copy link
Contributor

❌ Gradle check result for c32ca4a: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 6d5e663: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for bb9d3d6: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@kkewwei
Copy link
Contributor Author

kkewwei commented Mar 21, 2024

@reta @kotwanikunal TBR, thank you.

@reta
Copy link
Collaborator

reta commented Mar 21, 2024

❌ Gradle check result for bb9d3d6: FAILURE

Execution failed for task ':server:generateProto'.
> java.io.IOException: Cannot run program "/home/ubuntu/.gradle/caches/modules-2/files-2.1/com.google.protobuf/protoc/3.22.3/c262904eec72a197364a85569a4c8ab602a94ef5/protoc-3.22.3-linux-x86_64.exe": error=26, Text file busy

Copy link
Contributor

✅ Gradle check result for bb9d3d6: SUCCESS

@reta reta merged commit fd458d6 into opensearch-project:main Mar 21, 2024
49 of 57 checks passed
@reta reta added the backport 2.x Backport to 2.x branch label Mar 21, 2024
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 21, 2024
* Fix Flaky SimpleQueryStringIT Tests

Signed-off-by: kkewwei <kkewwei@163.com>

* add the comment to unit test

Signed-off-by: kkewwei <kkewwei@163.com>

---------

Signed-off-by: kkewwei <kkewwei@163.com>
(cherry picked from commit fd458d6)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
reta pushed a commit that referenced this pull request Mar 21, 2024
* Fix Flaky SimpleQueryStringIT Tests



* add the comment to unit test



---------


(cherry picked from commit fd458d6)

Signed-off-by: kkewwei <kkewwei@163.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>
@kkewwei kkewwei deleted the issue-12574 branch March 22, 2024 00:52
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
* Fix Flaky SimpleQueryStringIT Tests

Signed-off-by: kkewwei <kkewwei@163.com>

* add the comment to unit test

Signed-off-by: kkewwei <kkewwei@163.com>

---------

Signed-off-by: kkewwei <kkewwei@163.com>
Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch bug Something isn't working flaky-test Random test failure that succeeds on second run Search Search query, autocomplete ...etc skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] org.opensearch.search.query.SimpleQueryStringIT. testDocWithAllTypes is flaky
4 participants