Skip to content

Commit

Permalink
move index creation out of setup.
Browse files Browse the repository at this point in the history
Signed-off-by: Rishikesh1159 <[email protected]>
  • Loading branch information
Rishikesh1159 committed Oct 18, 2023
1 parent 267bd5a commit 10b94f1
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public class SegmentReplicationSuiteIT extends SegmentReplicationBaseIT {
@Before
public void setup() {
internalCluster().startClusterManagerOnlyNode();
createIndex(INDEX_NAME);
}

@Override
Expand All @@ -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();
Expand All @@ -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++) {
Expand All @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit 10b94f1

Please sign in to comment.