From 51567b8b67f4675656c0c3dfeb3a72279b449601 Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Thu, 27 Jan 2022 03:06:58 +0000 Subject: [PATCH 1/2] Added timeout to ensureGreen() for testClusterGreenAfterPartialRelocation Signed-off-by: Owais Kazi --- .../org/opensearch/cluster/routing/MovePrimaryFirstTests.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/test/java/org/opensearch/cluster/routing/MovePrimaryFirstTests.java b/server/src/test/java/org/opensearch/cluster/routing/MovePrimaryFirstTests.java index c484d0eb759fc..3ea6762d3829e 100644 --- a/server/src/test/java/org/opensearch/cluster/routing/MovePrimaryFirstTests.java +++ b/server/src/test/java/org/opensearch/cluster/routing/MovePrimaryFirstTests.java @@ -12,6 +12,7 @@ import org.opensearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest; import org.opensearch.cluster.ClusterStateListener; import org.opensearch.common.settings.Settings; +import org.opensearch.common.unit.TimeValue; import org.opensearch.test.InternalTestCluster; import org.opensearch.test.OpenSearchIntegTestCase; @@ -112,6 +113,6 @@ public void testClusterGreenAfterPartialRelocation() throws InterruptedException internalCluster().stopRandomNode(InternalTestCluster.nameFilter(z1n1)); internalCluster().stopRandomNode(InternalTestCluster.nameFilter(z1n2)); } catch (Exception e) {} - ensureGreen(); + ensureGreen(TimeValue.timeValueSeconds(60)); } } From 705f5e659add0738e0b0a0ffaaec8f6efb2f44cd Mon Sep 17 00:00:00 2001 From: Owais Kazi Date: Thu, 27 Jan 2022 08:11:25 +0000 Subject: [PATCH 2/2] Fixed spotless imports Signed-off-by: Owais Kazi --- .../java/org/opensearch/index/engine/InternalEngineTests.java | 1 - 1 file changed, 1 deletion(-) diff --git a/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java b/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java index 1296532b0ba0d..d20b151bb69bf 100644 --- a/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java +++ b/server/src/test/java/org/opensearch/index/engine/InternalEngineTests.java @@ -55,7 +55,6 @@ import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.LiveIndexWriterConfig; -import org.apache.lucene.index.LogByteSizeMergePolicy; import org.apache.lucene.index.LogDocMergePolicy; import org.apache.lucene.index.MergePolicy; import org.apache.lucene.index.NoMergePolicy;