Skip to content

Commit

Permalink
Merge branch 'KroxySystemTests' into KroxySystemTests-SB
Browse files Browse the repository at this point in the history
  • Loading branch information
franvila authored Nov 9, 2023
2 parents 8a1c89b + f3d8d09 commit 6c98c9f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 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(5, TimeUnit.SECONDS).until(() -> ProcessHandle.of(pid).isPresent());
}
return thread.isAlive() && ProcessHandle.of(pid).isPresent();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ private <T extends HasMetadata> ResourceType<T> 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 6c98c9f

Please sign in to comment.