]> juplo.de Git - demos/kafka/chat/commitdiff
test: HandoverIT-POC - RED - Started a second backend
authorKai Moritz <kai@juplo.de>
Fri, 8 Mar 2024 08:14:14 +0000 (09:14 +0100)
committerKai Moritz <kai@juplo.de>
Sun, 24 Mar 2024 19:27:45 +0000 (20:27 +0100)
* A second backend is started, after the writers and the listener were
  instanciated.
* The test fails, because the listener does not see messages, that are
  send by the writers after the rebalance finishes.
* Also changed the durations, that the setup waits for newly
  started backend-instances.

src/test/java/de/juplo/kafka/chat/backend/AbstractHandoverIT.java
src/test/java/de/juplo/kafka/chat/backend/AbstractHandoverITContainers.java

index 86875c596fcda830a0e33c44e36fab69b59cafb4..ae0f3a60f0641288a87ac9fea1a150f9006e0f52 100644 (file)
@@ -72,8 +72,9 @@ public abstract class AbstractHandoverIT
             "Received message: {}",
             message));
 
-    log.info("Sleeping for 2 seconds...");
-    Thread.sleep(2000);
+    log.info("Starting backend-2...");
+    containers.startBackend(containers.backend2, testWriters);
+    log.info("backend-2 started!");
 
     for (int i = 0; i < NUM_CLIENTS; i++)
     {
index 0bf7080d34deffd47621530458fc37e24d360791..f7c377e8e981fe62f0824e97ef447163929687dc 100644 (file)
@@ -99,7 +99,7 @@ public abstract class AbstractHandoverITContainers
     before = Instant.now();
     Awaitility
         .await()
-        .atMost(Duration.ofSeconds(30))
+        .atMost(Duration.ofSeconds(45))
         .until(() -> WebClient
             .create(backendUri)
             .get()
@@ -132,7 +132,7 @@ public abstract class AbstractHandoverITContainers
     before = Instant.now();
     Awaitility
         .await()
-        .atMost(Duration.ofSeconds(30))
+        .atMost(Duration.ofSeconds(15))
         .until(() -> WebClient
             .create("http://localhost:" + haproxy.getMappedPort(8400))
             .get()