From 67882d78aa633d1c4b4ff7cdc776e8d4f862c6fd Mon Sep 17 00:00:00 2001 From: Igor Motov Date: Tue, 1 Jul 2014 15:21:11 -0400 Subject: [PATCH] [TEST] Remove RANDOM_NO_DELETE_OPEN_FILE and RANDOM_PREVENT_DOUBLE_WRITE settings from snapshot/restore tests --- .../DedicatedClusterSnapshotRestoreTests.java | 17 ++++++----------- .../SharedClusterSnapshotRestoreTests.java | 10 ---------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/src/test/java/org/elasticsearch/snapshots/DedicatedClusterSnapshotRestoreTests.java b/src/test/java/org/elasticsearch/snapshots/DedicatedClusterSnapshotRestoreTests.java index 27d97a57735..2ec4068776e 100644 --- a/src/test/java/org/elasticsearch/snapshots/DedicatedClusterSnapshotRestoreTests.java +++ b/src/test/java/org/elasticsearch/snapshots/DedicatedClusterSnapshotRestoreTests.java @@ -100,7 +100,7 @@ public class DedicatedClusterSnapshotRestoreTests extends AbstractSnapshotTests logger.info("--> start 2 nodes"); Client client = client(); - assertAcked(prepareCreate("test-idx", 2, settingsBuilder().put("number_of_shards", 2).put("number_of_replicas", 0).put(MockDirectoryHelper.RANDOM_NO_DELETE_OPEN_FILE, false))); + assertAcked(prepareCreate("test-idx", 2, settingsBuilder().put("number_of_shards", 2).put("number_of_replicas", 0))); ensureGreen(); logger.info("--> indexing some data"); @@ -149,7 +149,7 @@ public class DedicatedClusterSnapshotRestoreTests extends AbstractSnapshotTests nodes.add(internalCluster().startNode()); Client client = client(); - assertAcked(prepareCreate("test-idx", 2, settingsBuilder().put("number_of_shards", 2).put("number_of_replicas", 0).put(MockDirectoryHelper.RANDOM_NO_DELETE_OPEN_FILE, false))); + assertAcked(prepareCreate("test-idx", 2, settingsBuilder().put("number_of_shards", 2).put("number_of_replicas", 0))); ensureGreen(); logger.info("--> indexing some data"); @@ -212,9 +212,7 @@ public class DedicatedClusterSnapshotRestoreTests extends AbstractSnapshotTests logger.info("--> create an index that will have some unallocated shards"); assertAcked(prepareCreate("test-idx-some", 2, settingsBuilder().put("number_of_shards", 6) - .put("number_of_replicas", 0) - .put(MockDirectoryHelper.RANDOM_NO_DELETE_OPEN_FILE, false) - .put(MockDirectoryHelper.RANDOM_PREVENT_DOUBLE_WRITE, false))); + .put("number_of_replicas", 0))); ensureGreen(); logger.info("--> indexing some data into test-idx-some"); @@ -230,8 +228,7 @@ public class DedicatedClusterSnapshotRestoreTests extends AbstractSnapshotTests logger.info("--> create an index that will have all allocated shards"); assertAcked(prepareCreate("test-idx-all", 1, settingsBuilder().put("number_of_shards", 6) - .put("number_of_replicas", 0) - .put(MockDirectoryHelper.RANDOM_NO_DELETE_OPEN_FILE, false))); + .put("number_of_replicas", 0))); ensureGreen("test-idx-all"); logger.info("--> indexing some data into test-idx-all"); @@ -244,8 +241,7 @@ public class DedicatedClusterSnapshotRestoreTests extends AbstractSnapshotTests logger.info("--> create an index that will have no allocated shards"); assertAcked(prepareCreate("test-idx-none", 1, settingsBuilder().put("number_of_shards", 6) .put("index.routing.allocation.include.tag", "nowhere") - .put("number_of_replicas", 0) - .put(MockDirectoryHelper.RANDOM_NO_DELETE_OPEN_FILE, false))); + .put("number_of_replicas", 0))); logger.info("--> create repository"); logger.info("--> creating repository"); @@ -456,8 +452,7 @@ public class DedicatedClusterSnapshotRestoreTests extends AbstractSnapshotTests private void createTestIndex(String name) { assertAcked(prepareCreate(name, 0, settingsBuilder().put("number_of_shards", between(1, 6)) - .put("number_of_replicas", between(1, 6)) - .put(MockDirectoryHelper.RANDOM_NO_DELETE_OPEN_FILE, false))); + .put("number_of_replicas", between(1, 6)))); ensureYellow(name); diff --git a/src/test/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreTests.java b/src/test/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreTests.java index 7cf730acf8c..9f8f5b52200 100644 --- a/src/test/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreTests.java +++ b/src/test/java/org/elasticsearch/snapshots/SharedClusterSnapshotRestoreTests.java @@ -62,16 +62,6 @@ import static org.hamcrest.Matchers.*; @Slow public class SharedClusterSnapshotRestoreTests extends AbstractSnapshotTests { - @Override - public Settings indexSettings() { - // During restore we frequently restore index to exactly the same state it was before, that might cause the same - // checksum file to be written twice during restore operation - return ImmutableSettings.builder().put(super.indexSettings()) - .put(MockDirectoryHelper.RANDOM_PREVENT_DOUBLE_WRITE, false) - .put(MockDirectoryHelper.RANDOM_NO_DELETE_OPEN_FILE, false) //TODO: Ask Simon if this is hiding an issue - .build(); - } - @Test public void basicWorkFlowTest() throws Exception { Client client = client();