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

Strengthen field-caps responses wire test #84596

Merged
merged 9 commits into from
Mar 15, 2022

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented Mar 3, 2022

Relates #83494

@dnhatn dnhatn added >test Issues or PRs that are addressing/adding tests :Search/Search Search-related issues that do not fall into other categories v8.2.0 labels Mar 3, 2022
@dnhatn dnhatn requested a review from javanna March 3, 2022 02:47
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Mar 3, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@dnhatn dnhatn requested review from jtibshirani and removed request for javanna March 3, 2022 20:35
Copy link
Contributor

@jtibshirani jtibshirani left a comment

Choose a reason for hiding this comment

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

Thanks, this is good to have!

Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

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

left a couple of comments, thanks for working on this.

Couple of thoughts I left on #83494 still apply I think: do we also test cases where the mapping hash does not come back from an older node, yet we write the response to another node, which may or may not support the mapping hash? One more thing I do in these cases is test reading the response from an older version by storing the older format in base64 obtained from the previous version, rather than simulated from the code of the current version.

@dnhatn
Copy link
Member Author

dnhatn commented Mar 8, 2022

@jtibshirani @javanna Thanks for reviews.

I think: do we also test cases where the mapping hash does not come back from an older node, yet we write the response to another node, which may or may not support the mapping hash?

I am not sure if we need this special test? Anyway, we have these scenarios covered in our tests: with and without mapping hash with different wire versions.

One more thing I do in these cases is test reading the response from an older version by storing the older format in base64 obtained from the previous version, rather than simulated from the code of the current version.

I can add this test, but I am not sure its benefit. Also, we prefer randomized tests for testing wire compact.

@dnhatn dnhatn requested a review from javanna March 8, 2022 04:12
@javanna
Copy link
Member

javanna commented Mar 8, 2022

I am not sure if we need this special test? Anyway, we have these scenarios covered in our tests: with and without mapping hash with different wire versions.

Can you expand on why you find it a special test? I was thinking that in the context of CCS, the one I described is a real-life scenario that our tests may not cover, but I am happy to discuss this.

I can add this test, but I am not sure its benefit. Also, we prefer randomized tests for testing wire compact.

Agreed that randomized tests are good and what you are adding expands our current coverage, but we can only simulate what would be written if the stream output was set to a certain previous version, and there are no guarantees that that is what the previous version really writes? What I am suggesting is that we read from the real bits that the previous version writes. Do you see what I mean?

@dnhatn
Copy link
Member Author

dnhatn commented Mar 9, 2022

@javanna I understand your comments, and I think there's disagreement on testing BWC here.

I was thinking that in the context of CCS, the one I described is a real-life scenario that our tests may not cover, but I am happy to discuss this.

I think we should write BWC tests with cross clusters with mixed versions instead.

Agreed that randomized tests are good and what you are adding expands our current coverage, but we can only simulate what would be written if the stream output was set to a certain previous version, and there are no guarantees that that is what the previous version really writes? What I am suggesting is that we read from the real bits that the previous version writes. Do you see what I mean?

I don't see many of us doing this. I think we should write mixed cluster tests (e.g., #84455) instead.

Anyway, let's move on. I added the tests as you suggested. Would you please take another look? Thank you!

Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

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

besides the comments I left, one minor peculiarity of these tests is that we create a list of index responses. Should we rather test using the FieldCapabilitiesNodeResponse which holds what we are creating in these tests?

@dnhatn dnhatn requested a review from javanna March 15, 2022 03:03
@dnhatn
Copy link
Member Author

dnhatn commented Mar 15, 2022

@jtibshirani @javanna Thanks for reviews.

@dnhatn dnhatn merged commit fd60d2a into elastic:master Mar 15, 2022
@dnhatn dnhatn deleted the wire_test_field_caps branch March 15, 2022 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Search/Search Search-related issues that do not fall into other categories Team:Search Meta label for search team >test Issues or PRs that are addressing/adding tests v8.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants