Skip to content

Commit

Permalink
Fix testNoMasterActionsMetadataWriteMasterBlock (#60605)
Browse files Browse the repository at this point in the history
We can't assert on the specific exception, unfortunately.
  • Loading branch information
ywelsch committed Aug 13, 2020
1 parent dd7410d commit 8e77539
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -326,7 +325,7 @@ public void testNoMasterActionsMetadataWriteMasterBlock() throws Exception {
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")
Expand All @@ -343,7 +342,7 @@ public void testNoMasterActionsMetadataWriteMasterBlock() throws Exception {
.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);
Expand Down

0 comments on commit 8e77539

Please sign in to comment.