-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Adjust randomization in ResolveClusterActionResponseTests #105932
Adjust randomization in ResolveClusterActionResponseTests #105932
Conversation
…ilures in testEqualsAndHashcode tests Fixes elastic#105898
Pinging @elastic/es-search (Team:Search) |
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, I added a comment that might make this fix even more succinct though.
@@ -52,6 +63,6 @@ protected Writeable.Reader<ResolveClusterActionResponse> instanceReader() { | |||
|
|||
@Override | |||
protected ResolveClusterActionResponse mutateInstance(ResolveClusterActionResponse response) { | |||
return new ResolveClusterActionResponse(randomResolveClusterInfoMap()); | |||
return new ResolveClusterActionResponse(randomResolveClusterInfoMap(() -> randomResolveClusterInfoWithErrorString())); |
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.
This is fine, but alternatively you could use the "randomValueOtherThan" helper method from ESTestCase that randomizes until it has created an object thats not equal to the input. Might save a bit of extra code here and be a bit more readably on the long run.
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.
Oh, cool. Thanks for the tip. Very helpful method! I've changed the code to use on the next push.
…5932) to avoid failures in `testEqualsAndHashcode` tests. Fixes elastic#105898
…5932) to avoid failures in `testEqualsAndHashcode` tests. Fixes elastic#105898
…5932) to avoid failures in `testEqualsAndHashcode` tests. Fixes elastic#105898
…5932) to avoid failures in `testEqualsAndHashcode` tests. Fixes elastic#105898
to avoid failures in
testEqualsAndHashcode
tests.Fixes #105898