Skip to content

Commit

Permalink
No issue: Try increasing the test cluster timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
reckart committed Nov 2, 2024
1 parent 70815bf commit 54b069d
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
19 changes: 19 additions & 0 deletions inception/inception-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,25 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.opensearch</groupId>
<artifactId>opensearch-common</artifactId>
<version>${opensearch.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-spatial</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-spatial-extras</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-spatial3d</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.opensearch</groupId>
<artifactId>opensearch-core</artifactId>
Expand Down
5 changes: 5 additions & 0 deletions inception/inception-external-search-opensearch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,10 @@
<artifactId>inception-model</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.opensearch</groupId>
<artifactId>opensearch-common</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,18 @@
import java.util.List;

import org.codelibs.opensearch.runner.OpenSearchRunner;
import org.codelibs.opensearch.runner.OpenSearchRunnerException;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.opensearch.LegacyESVersion;
import org.opensearch.action.admin.cluster.health.ClusterHealthResponse;
import org.opensearch.client.Requests;
import org.opensearch.cluster.health.ClusterHealthStatus;
import org.opensearch.common.Priority;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.settings.Settings.Builder;
import org.opensearch.common.unit.TimeValue;

import de.tudarmstadt.ukp.inception.externalsearch.ExternalSearchResult;
import de.tudarmstadt.ukp.inception.externalsearch.model.DocumentRepository;
Expand All @@ -52,7 +58,25 @@ public class OpenSearchProviderTest
@BeforeEach
public void setup()
{
osRunner = new OpenSearchRunner();
osRunner = new OpenSearchRunner()
{
@Override
public ClusterHealthStatus ensureYellow(final String... indices)
{
final ClusterHealthResponse actionGet = client().admin().cluster()
.health(Requests.clusterHealthRequest(indices)
.waitForNoRelocatingShards(true).waitForYellowStatus()
.waitForEvents(Priority.LANGUID))
.actionGet(TimeValue.timeValueSeconds(60));
if (actionGet.isTimedOut()) {
throw new OpenSearchRunnerException("ensureYellow timed out, cluster state:\n"
+ "\n" + client().admin().cluster().prepareState().get().getState()
+ "\n" + client().admin().cluster().preparePendingClusterTasks().get(),
actionGet);
}
return actionGet.getStatus();
}
};
osRunner.onBuild(new OpenSearchRunner.Builder()
{
@Override
Expand Down

0 comments on commit 54b069d

Please sign in to comment.