Skip to content

Commit

Permalink
waiting for Dapr to be done with init
Browse files Browse the repository at this point in the history
Signed-off-by: salaboy <Salaboy@gmail.com>
  • Loading branch information
salaboy committed Feb 28, 2025
1 parent 3581c1e commit 6cc33c2
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
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 @@ -59,6 +60,7 @@ public class DaprContainerIT {
private static final String KEY = "my-key";
private static final String PUBSUB_NAME = "pubsub";
private static final String PUBSUB_TOPIC_NAME = "topic";
private static final String DAPR_INIT_RUNNING_MESSAGE_PATTERN = ".*dapr initialized. Status: Running.*";

@Container
private static final DaprContainer DAPR_CONTAINER = new DaprContainer("daprio/daprd")
Expand Down Expand Up @@ -124,8 +126,8 @@ public void testStateStore() throws Exception {

@Test
public void testPlacement() throws Exception {
// Dapr and Placement need some time to connect
Thread.sleep(1000);

Wait.forLogMessage(DAPR_INIT_RUNNING_MESSAGE_PATTERN, 1).waitUntilReady(DAPR_CONTAINER);

OkHttpClient okHttpClient = new OkHttpClient.Builder()
.build();
Expand Down

0 comments on commit 6cc33c2

Please sign in to comment.