-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Replace mocks with test implementation in RepositoriesServiceTests #108589
Conversation
Pinging @elastic/es-distributed (Team:Distributed) |
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.
LGTM2, one nit
// cluster utils publisher does not call AckListener, making some method calls hang indefinitely | ||
// in this test we have a single master node, and it acknowledges cluster state immediately |
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.
👍
var resp = safeAwait(resultListener); | ||
assertTrue(resp.isAcknowledged()); |
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: would rather not use abbrs. for var. names wherever poss. :)
var resp = safeAwait(resultListener); | |
assertTrue(resp.isAcknowledged()); | |
var response = safeAwait(resultListener); | |
assertTrue(response.isAcknowledged()); |
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.
ofc
I observed that
testRegisterRepositorySuccessAfterCreationFailed
test never invokes assertion blocks, because listener is not invoked.There are 2 problems:
PutRepositories method relies on cluster state update. I replace mocked ClusterService and ThreadPool with test implementation of these. Also add blocking call on listener to ensure we get result.
Address comment to break down larger PR into smaller pieces in #108531