From 8ab3505416477713e5f89dab38ec1e967297b8e0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 8 May 2024 14:21:03 +0000 Subject: [PATCH] Fix flaky tests (#4329) Signed-off-by: Andrey Pleskach (cherry picked from commit bac93dc42a6e2182c6c8a6d220e92e6fc1d3510a) Signed-off-by: github-actions[bot] --- .../test/framework/cluster/LocalOpenSearchCluster.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/integrationTest/java/org/opensearch/test/framework/cluster/LocalOpenSearchCluster.java b/src/integrationTest/java/org/opensearch/test/framework/cluster/LocalOpenSearchCluster.java index 8a14daeb2d..0aee3705b5 100644 --- a/src/integrationTest/java/org/opensearch/test/framework/cluster/LocalOpenSearchCluster.java +++ b/src/integrationTest/java/org/opensearch/test/framework/cluster/LocalOpenSearchCluster.java @@ -105,8 +105,6 @@ public class LocalOpenSearchCluster { private File snapshotDir; - private int nodeCounter = 0; - public LocalOpenSearchCluster( String clusterName, ClusterManager clusterManager, @@ -302,10 +300,9 @@ private CompletableFuture startNodes( Iterator httpPortIterator = httpPorts.iterator(); List> 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])); } @@ -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;