-
Notifications
You must be signed in to change notification settings - Fork 685
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
SOLR-17581: Less ZK watches in tests. #3036
Conversation
Introduce new test variant of waitForState(), that does not wait on live node changes when we're only interested in the collection state.
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!
solr/solrj/src/test/org/apache/solr/common/cloud/PerReplicaStatesIntegrationTest.java
Show resolved
Hide resolved
return predicate.test(c); | ||
}); | ||
} catch (Exception e) { | ||
fail(message + "\n" + e.getMessage() + "\nLast available state: " + state.get()); |
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.
didn't propagate 'e'; can't we throw it before logging the last available state?
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.
I wanted to do the same as existing variant of waitForState()
(the one that watches both live nodes and the collection).
I think the two methods should be aligned. I think it makes sense to raise a JUnit specific error. Most of the time, the caught exception has no interesting details, it's just a timeout.
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.
ZkStateReader.waitForState has the wait unit params immediately after the collection name. I think the new waitForState you added should be consistent. Keeping the functional arg at the end seems like better style as well.
Not new but fair! I dislike parameter order since I've been looking at these methods. |
Introduce new test variant of waitForState(), that does not wait on live node changes when we're only interested in the collection state. This is a test change only. (cherry picked from commit bbbff85)
https://issues.apache.org/jira/browse/SOLR-17581
Description
Test creates lot of useless Zookeeper watches, because all waitForState() create a watch both on the collection state and the list of live nodes. Most of calls ignore live nodes when evaluating the predicate.
Solution
Introduce new test variant of waitForState(), that does not wait on live node changes when we're only interested in the collection state.
Tests
This is a test only change.
Checklist
Please review the following and check all that apply:
main
branch../gradlew check
.