From f6efc55556a8acf3f3c83aa2b824b34665e6ffc0 Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Sun, 7 Jul 2019 19:59:16 +0200 Subject: [PATCH] Fix SnapshotResiliencyTest (#44015) (#44041) * Closes #43989 --- .../org/elasticsearch/snapshots/SnapshotResiliencyTests.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/test/java/org/elasticsearch/snapshots/SnapshotResiliencyTests.java b/server/src/test/java/org/elasticsearch/snapshots/SnapshotResiliencyTests.java index cace7f1087c..744248d034d 100644 --- a/server/src/test/java/org/elasticsearch/snapshots/SnapshotResiliencyTests.java +++ b/server/src/test/java/org/elasticsearch/snapshots/SnapshotResiliencyTests.java @@ -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 {