Skip to content

Commit

Permalink
Fix flaky tests (opensearch-project#4329)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Pleskach <[email protected]>
  • Loading branch information
willyborankin authored May 8, 2024
1 parent faac5e3 commit bac93dc
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ public class LocalOpenSearchCluster {

private File snapshotDir;

private int nodeCounter = 0;

public LocalOpenSearchCluster(
String clusterName,
ClusterManager clusterManager,
Expand Down Expand Up @@ -302,10 +300,9 @@ private CompletableFuture<Void> startNodes(
Iterator<Integer> httpPortIterator = httpPorts.iterator();
List<CompletableFuture<StartStage>> futures = new ArrayList<>();

for (NodeSettings nodeSettings : nodeSettingList) {
Node node = new Node(nodeCounter, nodeSettings, transportPortIterator.next(), httpPortIterator.next());
for (var i = 0; i < nodeSettingList.size(); i++) {
Node node = new Node(i, nodeSettingList.get(i), transportPortIterator.next(), httpPortIterator.next());
futures.add(node.start());
nodeCounter += 1;
}
return CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]));
}
Expand Down Expand Up @@ -518,7 +515,6 @@ private Settings getOpenSearchSettings() {
.build();

if (nodeSettingsSupplier != null) {
// TODO node number
return Settings.builder().put(settings).put(nodeSettingsSupplier.get(nodeNumber)).build();
}
return settings;
Expand Down

0 comments on commit bac93dc

Please sign in to comment.