Fix flaky test in 95_search_after_shard_doc.yml #19746
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
See gradle check log: https://build.ci.opensearch.org/job/gradle-check/66006/console, the test is flaky when there're more than 10 documents in the shard 0, so the 2nd page starts from sort value 10, 11, and then a big value 4294967296, so when checking
- gt: { hits.hits.2.sort.0: $prev }, the right value and also the expected value is 11, left is 4294967296, we check the type of the expected value firstly and then convert the left value to the same type which is integer :OpenSearch/test/framework/src/main/java/org/opensearch/test/rest/yaml/section/Assertion.java
Line 94 in 29b113a
, so NumberFormatException is thrown.
The solution is to check the sort values reversely from the last document to the first document and use
ltinstead, at this point, we convert a small value to a long value, no error happens.Related Issues
#14408
Check List
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.