Skip to content

Commit

Permalink
Fix testRecoveryIsCancelledAfterDeletingTheIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
henningandersen committed Aug 18, 2021
1 parent d01efa4 commit 647a975
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -475,12 +475,6 @@ public void testRecoveryIsCancelledAfterDeletingTheIndex() throws Exception {
createSnapshot(repoName, "snap", Collections.singletonList(indexName));

String targetNode = internalCluster().startDataOnlyNode();
assertAcked(
client().admin().indices().prepareUpdateSettings(indexName)
.setSettings(Settings.builder()
.put("index.routing.allocation.require._name", targetNode)).get()
);

MockTransportService targetMockTransportService =
(MockTransportService) internalCluster().getInstance(TransportService.class, targetNode);

Expand All @@ -496,6 +490,12 @@ public void testRecoveryIsCancelledAfterDeletingTheIndex() throws Exception {
}
);

assertAcked(
client().admin().indices().prepareUpdateSettings(indexName)
.setSettings(Settings.builder()
.put("index.routing.allocation.require._name", targetNode)).get()
);

recoverSnapshotFileRequestReceived.await();

assertAcked(client().admin().indices().prepareDelete(indexName).get());
Expand Down

0 comments on commit 647a975

Please sign in to comment.