diff --git a/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptions.java b/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptions.java index 80625c477e7..9095f5ec785 100644 --- a/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptions.java +++ b/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptions.java @@ -817,7 +817,7 @@ public class DiscoveryWithServiceDisruptions extends ElasticsearchIntegrationTes while (nonMasterNode == null) { nonMasterNode = randomFrom(internalCluster().getNodeNames()); if (nonMasterNode.equals(masterNode)) { - masterNode = null; + nonMasterNode = null; } }