-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[Tests] Check QueryProfileShardResult parser robustness for new fields #25130
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
[Tests] Check QueryProfileShardResult parser robustness for new fields #25130
Conversation
javanna
left a comment
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.
LGTM thanks @cbuescher
| ensureExpectedToken(XContentParser.Token.START_ARRAY, parser.nextToken(), parser::getTokenLocation); | ||
| while((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) { | ||
| parseSearchProfileResultsEntry(parser, searchProfileResults); | ||
| ensureExpectedToken(XContentParser.Token.START_OBJECT, token, parser::getTokenLocation); |
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.
nit: we can check the expected token and then create the searchProfileResults map
| } | ||
|
|
||
| public void testFromXContent() throws IOException { | ||
| dofromXContentTestWithRandomFields(false); |
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.
nit: doFromXContentTestWithRandomFields
| } | ||
|
|
||
| public void testFromXContent() throws IOException { | ||
| dofromXContentTestWithRandomFields(false); |
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.
nit: doFromXContentTestWithRandomFields
6ddc312 to
18dd032
Compare
#25130) When parsing resonses we should be ignoring any new unknown fields or inner objects in most cases to be forward compatible with changes in core on the client side. This change adds test for this for QueryProfileShardResult and nested substructures and changes the parsing code where necessary to be able to ignore new fields and objects in the xContent.
When parsing resonses we should be ignoring any new unknown fields or inner objects in most cases to be forward compatible with changes in core on the
client side. This change adds test for this for QueryProfileShardResult and nested substructures and changes the parsing code where necessary to be able to
ignore new fields and objects in the xContent.