From 3cbb9293d6b5af8c1daed0cec050549d0fdb9fd0 Mon Sep 17 00:00:00 2001 From: marko-bekhta Date: Thu, 26 Oct 2023 15:49:15 +0200 Subject: [PATCH] Update OpenSearch container test configuration - Limit OpenSearch memory usage - Disable disk-based shard allocation thresholds --- .../deployment/DevServicesElasticsearchProcessor.java | 6 +++++- integration-tests/hibernate-search-orm-opensearch/pom.xml | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/extensions/elasticsearch-rest-client-common/deployment/src/main/java/io/quarkus/elasticsearch/restclient/common/deployment/DevServicesElasticsearchProcessor.java b/extensions/elasticsearch-rest-client-common/deployment/src/main/java/io/quarkus/elasticsearch/restclient/common/deployment/DevServicesElasticsearchProcessor.java index b1dc0461f5164..065acd241b0c0 100644 --- a/extensions/elasticsearch-rest-client-common/deployment/src/main/java/io/quarkus/elasticsearch/restclient/common/deployment/DevServicesElasticsearchProcessor.java +++ b/extensions/elasticsearch-rest-client-common/deployment/src/main/java/io/quarkus/elasticsearch/restclient/common/deployment/DevServicesElasticsearchProcessor.java @@ -268,7 +268,11 @@ private GenericContainer createOpensearchContainer(ElasticsearchDevServicesBu container.addEnv("bootstrap.memory_lock", "true"); container.addEnv("plugins.index_state_management.enabled", "false"); - + // Disable disk-based shard allocation thresholds: on large, relatively full disks (>90% used), + // it will lead to index creation to get stuck waiting for other nodes to join the cluster, + // which will never happen since we only have one node. + // See https://opensearch.org/docs/latest/api-reference/cluster-api/cluster-settings/ + container.addEnv("cluster.routing.allocation.disk.threshold_enabled", "false"); container.addEnv("OPENSEARCH_JAVA_OPTS", config.javaOpts); return container; } diff --git a/integration-tests/hibernate-search-orm-opensearch/pom.xml b/integration-tests/hibernate-search-orm-opensearch/pom.xml index f01ba89671a49..0dbdd56c2eafc 100644 --- a/integration-tests/hibernate-search-orm-opensearch/pom.xml +++ b/integration-tests/hibernate-search-orm-opensearch/pom.xml @@ -189,6 +189,13 @@ See https://opensearch.org/docs/latest/im-plugin/ism/settings/ --> false + -Xms512m -Xmx512m + + false 9200:9200