Skip to content

Commit

Permalink
increase cluster node timeout value for time consuming test cases (#1063
Browse files Browse the repository at this point in the history
)

Signed-off-by: will-hwang <[email protected]>
  • Loading branch information
will-hwang authored Jan 6, 2025
1 parent 4c119f0 commit 8803377
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class BatchIngestionIT extends AbstractRollingUpgradeTestCase {
private static final String EMBEDDING_FIELD_NAME = "passage_embedding";

public void testBatchIngestion_SparseEncodingProcessor_E2EFlow() throws Exception {
waitForClusterHealthGreen(NODES_BWC_CLUSTER);
waitForClusterHealthGreen(NODES_BWC_CLUSTER, 90);
String indexName = getIndexNameForTest();
String sparseModelId = null;
switch (getClusterType()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class MultiModalSearchIT extends AbstractRollingUpgradeTestCase {
// Create Text Image Embedding Processor, Ingestion Pipeline and add document
// Validate process , pipeline and document count in rolling-upgrade scenario
public void testTextImageEmbeddingProcessor_E2EFlow() throws Exception {
waitForClusterHealthGreen(NODES_BWC_CLUSTER);
waitForClusterHealthGreen(NODES_BWC_CLUSTER, 90);
switch (getClusterType()) {
case OLD:
modelId = uploadTextImageEmbeddingModel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class NeuralSparseSearchIT extends AbstractRollingUpgradeTestCase {
// Create Sparse Encoding Processor, Ingestion Pipeline and add document
// Validate process , pipeline and document count in rolling-upgrade scenario
public void testSparseEncodingProcessor_E2EFlow() throws Exception {
waitForClusterHealthGreen(NODES_BWC_CLUSTER);
waitForClusterHealthGreen(NODES_BWC_CLUSTER, 90);
switch (getClusterType()) {
case OLD:
modelId = uploadSparseEncodingModel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class SemanticSearchIT extends AbstractRollingUpgradeTestCase {
// Create Text Embedding Processor, Ingestion Pipeline and add document
// Validate process , pipeline and document count in rolling-upgrade scenario
public void testSemanticSearch_E2EFlow() throws Exception {
waitForClusterHealthGreen(NODES_BWC_CLUSTER);
waitForClusterHealthGreen(NODES_BWC_CLUSTER, 90);
switch (getClusterType()) {
case OLD:
modelId = uploadTextEmbeddingModel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1285,15 +1285,20 @@ protected String registerModelGroup(final String modelGroupRegisterRequestBody)
}

// Method that waits till the health of nodes in the cluster goes green
protected void waitForClusterHealthGreen(final String numOfNodes) throws IOException {
protected void waitForClusterHealthGreen(final String numOfNodes, final int timeoutInSeconds) throws IOException {
Request waitForGreen = new Request("GET", "/_cluster/health");
waitForGreen.addParameter("wait_for_nodes", numOfNodes);
waitForGreen.addParameter("wait_for_status", "green");
waitForGreen.addParameter("cluster_manager_timeout", "60s");
waitForGreen.addParameter("timeout", "60s");
waitForGreen.addParameter("cluster_manager_timeout", String.format(LOCALE, "%ds", timeoutInSeconds));
waitForGreen.addParameter("timeout", String.format(LOCALE, "%ds", timeoutInSeconds));
client().performRequest(waitForGreen);
}

// Method that waits till the health of nodes in the cluster goes green with default timeout value of 60
protected void waitForClusterHealthGreen(final String numOfNodes) throws IOException {
waitForClusterHealthGreen(numOfNodes, 60);
}

/**
* Add a single Doc to an index
*
Expand Down

0 comments on commit 8803377

Please sign in to comment.