From 8e775394ace244f114fa1e235862f4145aa15b45 Mon Sep 17 00:00:00 2001 From: Yannick Welsch Date: Thu, 13 Aug 2020 10:45:28 +0200 Subject: [PATCH] Fix testNoMasterActionsMetadataWriteMasterBlock (#60605) We can't assert on the specific exception, unfortunately. --- .../java/org/elasticsearch/cluster/NoMasterNodeIT.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/cluster/NoMasterNodeIT.java b/server/src/internalClusterTest/java/org/elasticsearch/cluster/NoMasterNodeIT.java index 457a131a904..2bfb020273d 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/cluster/NoMasterNodeIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/cluster/NoMasterNodeIT.java @@ -20,7 +20,6 @@ package org.elasticsearch.cluster; import org.elasticsearch.action.ActionRequestBuilder; -import org.elasticsearch.action.UnavailableShardsException; import org.elasticsearch.action.admin.cluster.configuration.AddVotingConfigExclusionsAction; import org.elasticsearch.action.admin.cluster.configuration.AddVotingConfigExclusionsRequest; import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse; @@ -326,7 +325,7 @@ public class NoMasterNodeIT extends ESIntegTestCase { client(randomFrom(nodesWithShards)).prepareUpdate("test1", "type1", "1") .setDoc(Requests.INDEX_CONTENT_TYPE, "field", "value2").setTimeout(timeout).get(); - expectThrows(UnavailableShardsException.class, () -> client(partitionedNode).prepareUpdate("test1", "type1", "1") + expectThrows(Exception.class, () -> client(partitionedNode).prepareUpdate("test1", "type1", "1") .setDoc(Requests.INDEX_CONTENT_TYPE, "field", "value2").setTimeout(timeout).get()); client(randomFrom(nodesWithShards)).prepareIndex("test1", "type1").setId("1") @@ -343,7 +342,7 @@ public class NoMasterNodeIT extends ESIntegTestCase { .setId("1") .setSource(XContentFactory.jsonBuilder().startObject().endObject()).setTimeout(timeout).get()); - expectThrows(UnavailableShardsException.class, () -> client(partitionedNode).prepareIndex("test1", "type1").setId("1") + expectThrows(Exception.class, () -> client(partitionedNode).prepareIndex("test1", "type1").setId("1") .setSource(XContentFactory.jsonBuilder().startObject().endObject()).setTimeout(timeout).get()); internalCluster().clearDisruptionScheme(true);