Skip to content

Commit

Permalink
Fix testRecoveryIsCancelledAfterDeletingTheIndex (#76644)
Browse files Browse the repository at this point in the history
Closes #76560
  • Loading branch information
henningandersen committed Aug 23, 2021
1 parent 574a39f commit 0237cd3
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 0237cd3

Please sign in to comment.