Add unit test for TransportReloadRemoteClusterCredentialsAction#139414
Merged
JeremyDahlgren merged 4 commits intoelastic:mainfrom Dec 13, 2025
Merged
Conversation
Adds a new unit test class for TransportReloadRemoteClusterCredentialsAction. This is a follow up from elastic#135491, where a significant chunk of code was moved from RemoteClusterService into TransportReloadRemoteClusterCredentialsAction. This also verifies code touched recently in elastic#139012. Resolves: ES-13161
Collaborator
|
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
ywangd
approved these changes
Dec 12, 2025
| clusterService.getClusterApplierService() | ||
| .setInitialState(new ClusterState.Builder(clusterService.getClusterName()).blocks(blocks).build()); | ||
| Consumer<ActionListener<ActionResponse.Empty>> consumer = listener -> action.execute(task, request, listener); | ||
| expectThrows(ClusterBlockException.class, () -> { throw safeAwaitFailure(consumer); }); |
Member
There was a problem hiding this comment.
Seems unnecessary to throw it again?
Suggested change
| expectThrows(ClusterBlockException.class, () -> { throw safeAwaitFailure(consumer); }); | |
| assertThat(safeAwaitFailure(consumer), instanceOf(ClusterBlockException.class)); |
or we can inline the consumer with
safeAwaitFailure(ClusterBlockException.class, ActionResponse.Empty.class, l -> action.execute(task, request, l));
Comment on lines
+185
to
+186
| .put("cluster.remote.foo.proxy_address", remoteNode.getAddress().toString()) | ||
| .setSecureSettings(toSecureSettings("foo", randomAlphaOfLength(10))) |
Member
There was a problem hiding this comment.
It's better if the test does not change the proxy_address so that we can verify the behaviour with just the credentials update.
parkertimmins
pushed a commit
to parkertimmins/elasticsearch
that referenced
this pull request
Dec 17, 2025
…astic#139414) Adds a new unit test class for TransportReloadRemoteClusterCredentialsAction. This is a follow up from elastic#135491, where a significant chunk of code was moved from RemoteClusterService into TransportReloadRemoteClusterCredentialsAction. This also verifies code touched recently in elastic#139012. Resolves: ES-13161
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new unit test class for
TransportReloadRemoteClusterCredentialsAction. This is a follow up from #135491, where a significant chunk of code was moved fromRemoteClusterServiceintoTransportReloadRemoteClusterCredentialsAction. This also verifies code touched recently in #139012.Resolves: ES-13161