-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[CI] Fix testClientsLifeCycleForSingleProject #128718
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
Conversation
More robust test for closed clients holder. Also changes IllegalStateException to AlreadyClosedException for both closed manager and holder. Resolves: elastic#128707
|
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
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 with one small suggestion about a slightly tighter assertion
| final var e = expectThrows(AlreadyClosedException.class, () -> { | ||
| var client = clientsHolder.client(createRepositoryMetadata(randomFrom(clientName, anotherClientName))); | ||
| client.decRef(); | ||
| }); | ||
| assertThat(e.getMessage(), containsString("Project [" + projectId + "] clients holder is closed")); |
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: doing all of this inside the assertBusy() means that we will still pass the test if we temporarily throw a different exception during shutdown. It'd be better if we just looped until we see some exception, and then asserted that the first-thrown exception is an AlreadyClosedException with the right message.
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.
Makes sense. See b995e28. Thanks!
More robust test for closed clients holder. Also changes IllegalStateException to AlreadyClosedException for both closed manager and holder. Resolves: #128707
More robust test for closed clients holder. Also changes IllegalStateException to AlreadyClosedException for both closed manager and holder. Resolves: elastic#128707
More robust test for closed clients holder. Also changes IllegalStateException to AlreadyClosedException for both closed manager and holder. Resolves: elastic#128707
More robust test for closed clients holder. Also changes IllegalStateException to AlreadyClosedException for both closed manager and holder. Resolves: elastic#128707
More robust test for closed clients holder. Also changes IllegalStateException to AlreadyClosedException for both closed manager and holder.
Resolves: #128707