Fix SnapshotResiliencyTest (#44015) (#44041)

* Closes #43989
This commit is contained in:
Armin Braun 2019-07-07 19:59:16 +02:00 committed by GitHub
parent 990ac4ca83
commit f6efc55556
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -769,7 +769,9 @@ public class SnapshotResiliencyTests extends ESTestCase {
}
private static ClusterState stateForNode(ClusterState state, DiscoveryNode node) {
return ClusterState.builder(state).nodes(DiscoveryNodes.builder(state.nodes()).localNodeId(node.getId())).build();
// Remove and add back local node to update ephemeral id on restarts
return ClusterState.builder(state).nodes(DiscoveryNodes.builder(
state.nodes()).remove(node.getId()).add(node).localNodeId(node.getId())).build();
}
private final class TestClusterNodes {