Skip to content

Commit

Permalink
Harden the WeaviateContainer initialization to prevent IT instability
Browse files Browse the repository at this point in the history
  • Loading branch information
tzolov committed Aug 20, 2024
1 parent 1465310 commit 4cc9a9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.Map;

import org.junit.jupiter.api.Test;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;

Expand Down Expand Up @@ -50,7 +51,8 @@
public class WeaviateVectorStoreAutoConfigurationIT {

@Container
static WeaviateContainer weaviate = new WeaviateContainer("semitechnologies/weaviate:1.25.4");
static WeaviateContainer weaviate = new WeaviateContainer("semitechnologies/weaviate:1.25.4")
.waitingFor(Wait.forHttp("/v1/.well-known/ready").forPort(8080));

private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(WeaviateVectorStoreAutoConfiguration.class))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.core.io.DefaultResourceLoader;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.weaviate.WeaviateContainer;
Expand All @@ -51,7 +52,8 @@
public class WeaviateVectorStoreIT {

@Container
static WeaviateContainer weaviateContainer = new WeaviateContainer("semitechnologies/weaviate:1.25.4");
static WeaviateContainer weaviateContainer = new WeaviateContainer("semitechnologies/weaviate:1.25.4")
.waitingFor(Wait.forHttp("/v1/.well-known/ready").forPort(8080));

private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
.withUserConfiguration(TestApplication.class);
Expand Down

0 comments on commit 4cc9a9c

Please sign in to comment.