From f0984eb409d44e8b68deb1c262bf81accc300acb Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 9 Feb 2022 14:25:30 +0530 Subject: [PATCH] Added timeout to ensureGreen() for testClusterGreenAfterPartialRelocation (#2074) Signed-off-by: Ankit Jain --- .../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 7d26fe3b56315..fba6f1d48930b 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; @@ -121,6 +122,6 @@ public void testClusterGreenAfterPartialRelocation() throws InterruptedException internalCluster().stopRandomNode(InternalTestCluster.nameFilter(z1n1)); internalCluster().stopRandomNode(InternalTestCluster.nameFilter(z1n2)); } catch (Exception e) {} - ensureGreen(); + ensureGreen(TimeValue.timeValueSeconds(60)); } }