[TEST] reduce the number of snapshotted shards to 1 in testSnapshotSucceedsAfterSnapshotFailure()

so that we are more likely to trigger I/O exceptions on writing the control files during the
finalize phase of snapshotting (with the aim of triggering an I/O failure when writing pending-index-*).
This commit is contained in:
Ali Beyad 2016-11-11 16:20:26 -05:00
parent 5336e72fbb
commit 5f1d108704
1 changed files with 5 additions and 1 deletions

View File

@ -2683,7 +2683,11 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
.put("random", randomAsciiOfLength(10))));
logger.info("--> indexing some data");
createIndex("test-idx");
assertAcked(prepareCreate("test-idx").setSettings(
// the less the number of shards, the less control files we have, so we are giving a higher probability of
// triggering an IOException toward the end when writing the pending-index-* files, which are the files
// that caused problems with writing subsequent snapshots if they happened to be lingering in the repository
Settings.builder().put(SETTING_NUMBER_OF_SHARDS, 1).put(SETTING_NUMBER_OF_REPLICAS, 0)));
ensureGreen();
final int numDocs = randomIntBetween(1, 5);
for (int i = 0; i < numDocs; i++) {