Skip to content

Commit

Permalink
Fix flaky tests (#4329)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Pleskach <[email protected]>
(cherry picked from commit bac93dc)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed May 8, 2024
1 parent 10f1515 commit 8ab3505
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 8ab3505

Please sign in to comment.