-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Counted keyword randomized testing #121462
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
Counted keyword randomized testing #121462
Conversation
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
|
|
||
| this.valueGenerator = arrays.wrapper().compose(nulls.wrapper()).apply(() -> { | ||
| if (previousStrings.size() > 0 && ESTestCase.randomBoolean()) { | ||
| return ESTestCase.randomFrom(previousStrings); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not directly use ESTestCase here, it should be hidden inside DataSource. You can probably define a generic "repeating" wrapper but i haven't looked too closely.
| } | ||
| } | ||
|
|
||
| return counts.isEmpty(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
As a result of the randomized testing enabled in #121462, we found that we currently fail to parse documents with arrays of objects containing counted_keyword fields. This PR fixes this issue by using a custom docvalues field to store the count instead of the built-in lucene BinaryDocValues. This custom CountsBinaryDocValuesField has logic to handle multiple values for the same field.
This patch adds the needed data generator and source matcher to include counted_keyword fields in our randomized testing. This patch also updates the source matcher such that field-specific matchers are checked before the generic matcher is used. It seems that this is the correct behavior, and the only reason the generic matcher was checked first was as a workaround for issue elastic#111916, which is now closed. (cherry picked from commit 061920b)
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
As a result of the randomized testing enabled in #121462, we found that we currently fail to parse documents with arrays of objects containing counted_keyword fields. This PR fixes this issue by using a custom docvalues field to store the count instead of the built-in lucene BinaryDocValues. This custom CountsBinaryDocValuesField has logic to handle multiple values for the same field. (cherry picked from commit 13b743c)
This patch adds the needed data generator and source matcher to include counted_keyword fields in our randomized testing. This patch also updates the source matcher such that field-specific matchers are checked before the generic matcher is used. It seems that this is the correct behavior, and the only reason the generic matcher was checked first was as a workaround for issue #111916, which is now closed. (cherry picked from commit 061920b)
This patch adds the needed data generator and source matcher to include
counted_keywordfields in our randomized testing.This patch also updates the source matcher such that field-specific matchers are checked before the generic matcher is used. It seems that this is the correct behavior, and the only reason the generic matcher was checked first was as a workaround for issue #111916, which is now closed.