diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/snapshots/SourceOnlySnapshotIT.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/snapshots/SourceOnlySnapshotIT.java index a025b07a8eb..00b199eef44 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/snapshots/SourceOnlySnapshotIT.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/snapshots/SourceOnlySnapshotIT.java @@ -28,7 +28,6 @@ import org.elasticsearch.index.MockEngineFactoryPlugin; import org.elasticsearch.index.engine.EngineFactory; import org.elasticsearch.index.mapper.SeqNoFieldMapper; import org.elasticsearch.index.query.QueryBuilders; -import org.elasticsearch.node.Node; import org.elasticsearch.plugins.EnginePlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.RepositoryPlugin; @@ -48,13 +47,13 @@ import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; -import java.util.concurrent.ExecutionException; import java.util.function.BiConsumer; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount; +@ESIntegTestCase.ClusterScope(numDataNodes = 0) public class SourceOnlySnapshotIT extends ESIntegTestCase { @Override @@ -92,12 +91,6 @@ public class SourceOnlySnapshotIT extends ESIntegTestCase { } } - public void testToStopSuiteFailing() { - // This is required because otherwise every test in the suite is muted - // TODO remove this when one of the other tests is fixed - } - - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/36330") public void testSnapshotAndRestore() throws Exception { final String sourceIdx = "test-idx"; boolean requireRouting = randomBoolean(); @@ -128,7 +121,6 @@ public class SourceOnlySnapshotIT extends ESIntegTestCase { assertHits(sourceIdx, builders.length, sourceHadDeletions); } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/36276") public void testSnapshotAndRestoreWithNested() throws Exception { final String sourceIdx = "test-idx"; boolean requireRouting = randomBoolean(); @@ -215,12 +207,13 @@ public class SourceOnlySnapshotIT extends ESIntegTestCase { client().prepareClearScroll().addScrollId(searchResponse.getScrollId()).get(); } } - } - private IndexRequestBuilder[] snashotAndRestore(String sourceIdx, int numShards, boolean minimal, boolean requireRouting, boolean - useNested) - throws ExecutionException, InterruptedException, IOException { + private IndexRequestBuilder[] snashotAndRestore(final String sourceIdx, + final int numShards, + final boolean minimal, + final boolean requireRouting, + final boolean useNested) throws InterruptedException, IOException { logger.info("--> starting a master node and a data node"); internalCluster().startMasterOnlyNode(); internalCluster().startDataOnlyNode(); @@ -284,12 +277,8 @@ public class SourceOnlySnapshotIT extends ESIntegTestCase { internalCluster().stopRandomDataNode(); client().admin().cluster().prepareHealth().setTimeout("30s").setWaitForNodes("1"); - logger.info("--> start a new data node"); - final Settings dataSettings = Settings.builder() - .put(Node.NODE_NAME_SETTING.getKey(), randomAlphaOfLength(5)) - .put(Environment.PATH_HOME_SETTING.getKey(), createTempDir()) // to get a new node id - .build(); - internalCluster().startDataOnlyNode(dataSettings); + final String newDataNode = internalCluster().startDataOnlyNode(); + logger.info("--> start a new data node " + newDataNode); client().admin().cluster().prepareHealth().setTimeout("30s").setWaitForNodes("2"); logger.info("--> restore the index and ensure all shards are allocated");