From c007091470e6849d802a59fe2b5f8c28b1cefbeb Mon Sep 17 00:00:00 2001 From: Francisco Vila Date: Thu, 9 Nov 2023 09:13:33 +0100 Subject: [PATCH 1/4] Adding Sam changes --- .../systemtests/resources/manager/ResourceManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From 6f7a50c2a7028385a385189bfbe918c89d353ec4 Mon Sep 17 00:00:00 2001 From: Francisco Vila Date: Thu, 9 Nov 2023 09:46:43 +0100 Subject: [PATCH 2/4] improved app --- .../installation/kroxylicious/KroxyliciousApp.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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..187e829eb2 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(3, TimeUnit.SECONDS).until(() -> ProcessHandle.of(pid).isPresent()); } return thread.isAlive() && ProcessHandle.of(pid).isPresent(); } From edd597961c07ba43d3a3d79232a4351e5d908798 Mon Sep 17 00:00:00 2001 From: Francisco Vila Date: Thu, 9 Nov 2023 09:47:43 +0100 Subject: [PATCH 3/4] improved app --- .../systemtests/installation/kroxylicious/KroxyliciousApp.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 187e829eb2..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 @@ -110,7 +110,7 @@ public String getBootstrap() { */ public boolean isRunning() { if (thread.isAlive()) { - await().atMost(3, TimeUnit.SECONDS).until(() -> ProcessHandle.of(pid).isPresent()); + await().atMost(5, TimeUnit.SECONDS).until(() -> ProcessHandle.of(pid).isPresent()); } return thread.isAlive() && ProcessHandle.of(pid).isPresent(); } From f3d8d09c81d11ed1659cc0fd1530e9bc316178d7 Mon Sep 17 00:00:00 2001 From: Francisco Vila Date: Thu, 9 Nov 2023 09:59:52 +0100 Subject: [PATCH 4/4] Added toLowerCase to resolveParameter --- .../systemtests/extensions/KroxyliciousExtension.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 91c3049b89..9eba5bfa19 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 @@ -47,7 +47,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 namespace; } }