From 10b94f11915772774d582991f10947d3d9e7f45f Mon Sep 17 00:00:00 2001 From: Rishikesh1159 Date: Wed, 18 Oct 2023 19:12:27 +0000 Subject: [PATCH] move index creation out of setup. Signed-off-by: Rishikesh1159 --- .../indices/replication/SegmentReplicationSuiteIT.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationSuiteIT.java b/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationSuiteIT.java index 800704eae7fa7..924d01a6d478b 100644 --- a/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationSuiteIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/indices/replication/SegmentReplicationSuiteIT.java @@ -21,7 +21,6 @@ public class SegmentReplicationSuiteIT extends SegmentReplicationBaseIT { @Before public void setup() { internalCluster().startClusterManagerOnlyNode(); - createIndex(INDEX_NAME); } @Override @@ -38,6 +37,7 @@ public Settings indexSettings() { } public void testBasicReplication() throws Exception { + createIndex(INDEX_NAME); final int docCount = scaledRandomIntBetween(10, 200); for (int i = 0; i < docCount; i++) { client().prepareIndex(INDEX_NAME).setId(Integer.toString(i)).setSource("field", "value" + i).execute().get(); @@ -50,6 +50,7 @@ public void testBasicReplication() throws Exception { public void testDropRandomNodeDuringReplication() throws Exception { internalCluster().ensureAtLeastNumDataNodes(2); internalCluster().startClusterManagerOnlyNodes(1); + createIndex(INDEX_NAME); final int docCount = scaledRandomIntBetween(10, 200); for (int i = 0; i < docCount; i++) { @@ -67,6 +68,7 @@ public void testDropRandomNodeDuringReplication() throws Exception { public void testDeleteIndexWhileReplicating() throws Exception { internalCluster().startClusterManagerOnlyNode(); + createIndex(INDEX_NAME); final int docCount = scaledRandomIntBetween(10, 200); for (int i = 0; i < docCount; i++) { client().prepareIndex(INDEX_NAME).setId(Integer.toString(i)).setSource("field", "value" + i).execute().get(); @@ -77,6 +79,7 @@ public void testDeleteIndexWhileReplicating() throws Exception { public void testFullRestartDuringReplication() throws Exception { internalCluster().startNode(); + createIndex(INDEX_NAME); final int docCount = scaledRandomIntBetween(10, 200); for (int i = 0; i < docCount; i++) { client().prepareIndex(INDEX_NAME).setId(Integer.toString(i)).setSource("field", "value" + i).execute().get();