diff --git a/kroxylicious-systemtests/src/main/java/io/kroxylicious/systemtests/installation/kroxylicious/KroxyliciousApp.java b/kroxylicious-systemtests/src/main/java/io/kroxylicious/systemtests/installation/kroxylicious/KroxyliciousApp.java index 571f3af643..76e1f690d2 100644 --- a/kroxylicious-systemtests/src/main/java/io/kroxylicious/systemtests/installation/kroxylicious/KroxyliciousApp.java +++ b/kroxylicious-systemtests/src/main/java/io/kroxylicious/systemtests/installation/kroxylicious/KroxyliciousApp.java @@ -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; @@ -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. @@ -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); @@ -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(5, TimeUnit.SECONDS).until(() -> ProcessHandle.of(pid).isPresent()); } return thread.isAlive() && ProcessHandle.of(pid).isPresent(); } diff --git a/kroxylicious-systemtests/src/main/java/io/kroxylicious/systemtests/resources/manager/ResourceManager.java b/kroxylicious-systemtests/src/main/java/io/kroxylicious/systemtests/resources/manager/ResourceManager.java index 2827e78339..6288a85e46 100644 --- a/kroxylicious-systemtests/src/main/java/io/kroxylicious/systemtests/resources/manager/ResourceManager.java +++ b/kroxylicious-systemtests/src/main/java/io/kroxylicious/systemtests/resources/manager/ResourceManager.java @@ -237,7 +237,7 @@ private ResourceType findResourceType(T resource) { long resourceTimeoutMs) { LOGGER.info("Waiting for {}: {}/{} will have desired state 'Ready'", kind, namespace, name); - TestUtils.waitFor(String.format("%s: %s#%s will have desired state 'Ready'", kind, namespace, name), + TestUtils.waitFor(String.format("%s: %s/%s will have desired state 'Ready'", kind, namespace, name), Constants.POLL_INTERVAL_FOR_RESOURCE_READINESS_MILLIS, resourceTimeoutMs, () -> { final Status status = operation.inNamespace(namespace) diff --git a/kroxylicious-systemtests/src/test/java/io/kroxylicious/systemtests/extensions/KroxyliciousExtension.java b/kroxylicious-systemtests/src/test/java/io/kroxylicious/systemtests/extensions/KroxyliciousExtension.java index 9bb57329b3..bbbe9a8cec 100644 --- a/kroxylicious-systemtests/src/test/java/io/kroxylicious/systemtests/extensions/KroxyliciousExtension.java +++ b/kroxylicious-systemtests/src/test/java/io/kroxylicious/systemtests/extensions/KroxyliciousExtension.java @@ -49,7 +49,7 @@ public Object resolveParameter(ParameterContext parameterContext, ExtensionConte Class type = parameter.getType(); LOGGER.trace("test {}: Resolving parameter ({} {})", extensionContext.getUniqueId(), type.getSimpleName(), parameter.getName()); if (String.class.getTypeName().equals(type.getName())) { - if (parameter.getName().contains("namespace")) { + if (parameter.getName().toLowerCase().contains("namespace")) { return extractK8sNamespace(extensionContext); } }