[TESTS] Ignore SnapshotMissingException in snapshotWithStuckNodeTest

The retry mechanism in the transport layer might cause the delete snapshot request to be executed twice if the cluster master is closed while the request is executed. First time delete snapshot request is getting successfully executed on the old master and then it is retried on the newly elected master. When the new master tries to delete the snapshot - the snapshot no longer exists (since it was successfully deleted by the old master) and SnapshotMissingException is returned.
This commit is contained in:
Igor Motov 2014-05-17 11:18:11 -04:00
parent c20713530d
commit a3581959d7
1 changed files with 8 additions and 2 deletions

View File

@ -178,8 +178,14 @@ public class DedicatedClusterSnapshotRestoreTests extends AbstractSnapshotTests
unblockNode(blockedNode);
logger.info("--> stopping node", blockedNode);
stopNode(blockedNode);
DeleteSnapshotResponse deleteSnapshotResponse = deleteSnapshotResponseFuture.get();
assertThat(deleteSnapshotResponse.isAcknowledged(), equalTo(true));
try {
DeleteSnapshotResponse deleteSnapshotResponse = deleteSnapshotResponseFuture.actionGet();
assertThat(deleteSnapshotResponse.isAcknowledged(), equalTo(true));
} catch (SnapshotMissingException ex) {
// When master node is closed during this test, it sometime manages to delete the snapshot files before
// completely stopping. In this case the retried delete snapshot operation on the new master can fail
// with SnapshotMissingException
}
logger.info("--> making sure that snapshot no longer exists");
assertThrows(client().admin().cluster().prepareGetSnapshots("test-repo").setSnapshots("test-snap").execute(), SnapshotMissingException.class);