Skip to content

Commit 6b95ae1

Browse files
DaveCTurnerdavidkyle
authored andcommitted
Avoid leaking blackholed register ops in tests (elastic#114287)
Today when we reboot a node in a test case derived from `AbstractCoordinatorTestCase` we lose the contents of `blackholedRegisterOperations`, but it's important that these operations _eventually_ run. With this commit we copy these operations over into the new node.
1 parent 4e8b0b3 commit 6b95ae1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/framework/src/main/java/org/elasticsearch/cluster/coordination/AbstractCoordinatorTestCase.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@ ClusterNode restartedNode(
12501250
.roles(localNode.isMasterNode() && DiscoveryNode.isMasterNode(settings) ? ALL_ROLES_EXCEPT_VOTING_ONLY : emptySet())
12511251
.build();
12521252
try {
1253-
return new ClusterNode(
1253+
final var restartedNode = new ClusterNode(
12541254
nodeIndex,
12551255
newLocalNode,
12561256
(node, threadPool) -> createPersistedStateFromExistingState(
@@ -1263,6 +1263,8 @@ ClusterNode restartedNode(
12631263
settings,
12641264
nodeHealthService
12651265
);
1266+
restartedNode.blackholedRegisterOperations.addAll(blackholedRegisterOperations);
1267+
return restartedNode;
12661268
} finally {
12671269
clearableRecycler.clear();
12681270
}

0 commit comments

Comments
 (0)