Skip to content

Commit

Permalink
[Remote Store] Fixing flaky test - RemoteIndexPrimaryRelocationIT (#9807
Browse files Browse the repository at this point in the history
) (#9819)

* [Remote Store] Fixing flaky test - RemoteIndexPrimaryRelocationIT



* Adding numDataNodes to 0 for remot store tests



---------


(cherry picked from commit 1b41fa0)

Signed-off-by: Dharmesh 💤 <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 12ac2a8 commit 053df8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,12 @@ public class IndexPrimaryRelocationIT extends OpenSearchIntegTestCase {

private static final int RELOCATION_COUNT = 15;

public void setup() {}

public Settings indexSettings() {
return Settings.builder().put("index.number_of_shards", 1).put("index.number_of_replicas", 0).build();
}

public void testPrimaryRelocationWhileIndexing() throws Exception {
internalCluster().ensureAtLeastNumDataNodes(randomIntBetween(2, 3));
setup();
client().admin().indices().prepareCreate("test").setSettings(indexSettings()).setMapping("field", "type=text").get();
ensureGreen("test");
AtomicInteger numAutoGenDocs = new AtomicInteger();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,17 @@

import static org.opensearch.remotestore.RemoteStoreBaseIntegTestCase.remoteStoreClusterSettings;

@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.TEST)
@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.TEST, numDataNodes = 0)
public class RemoteIndexPrimaryRelocationIT extends IndexPrimaryRelocationIT {

protected static final String REPOSITORY_NAME = "test-remote-store-repo";

protected Path absolutePath;

public void setup() {
absolutePath = randomRepoPath().toAbsolutePath();
}

protected Settings nodeSettings(int nodeOrdinal) {
if (absolutePath == null) {
absolutePath = randomRepoPath().toAbsolutePath();
}
return Settings.builder()
.put(super.nodeSettings(nodeOrdinal))
.put(remoteStoreClusterSettings(REPOSITORY_NAME, absolutePath))
Expand Down Expand Up @@ -61,6 +60,7 @@ protected Settings featureFlagSettings() {
}

public void testPrimaryRelocationWhileIndexing() throws Exception {
internalCluster().startClusterManagerOnlyNode();
super.testPrimaryRelocationWhileIndexing();
}
}

0 comments on commit 053df8c

Please sign in to comment.