Skip to content

Commit

Permalink
improved app
Browse files Browse the repository at this point in the history
  • Loading branch information
franvila committed Nov 9, 2023
1 parent c007091 commit 6f7a50c
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Iterator;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Stream;

Expand All @@ -22,7 +23,8 @@

import io.kroxylicious.systemtests.executor.Exec;
import io.kroxylicious.systemtests.templates.kroxylicious.KroxyConfigTemplates;
import io.kroxylicious.systemtests.utils.TestUtils;

import static org.testcontainers.shaded.org.awaitility.Awaitility.await;

/**
* The type Kroxylicious app.
Expand Down Expand Up @@ -57,8 +59,8 @@ public void run() {
}
});
file = File.createTempFile("config", ".yaml");
file.deleteOnExit();
Files.writeString(file.toPath(), KroxyConfigTemplates.getDefaultExternalKroxyConfigMap(clusterIp));
file.deleteOnExit();
}
catch (IOException e) {
throw new RuntimeException(e);
Expand Down Expand Up @@ -108,7 +110,7 @@ public String getBootstrap() {
*/
public boolean isRunning() {
if (thread.isAlive()) {
TestUtils.waitFor("Waiting for process being launched", 500, 3000, () -> ProcessHandle.of(pid).isPresent());
await().atMost(3, TimeUnit.SECONDS).until(() -> ProcessHandle.of(pid).isPresent());
}
return thread.isAlive() && ProcessHandle.of(pid).isPresent();
}
Expand Down

0 comments on commit 6f7a50c

Please sign in to comment.