Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.5.z] Backport Fix the Keycloak memory issue on Podman setting JAVA_OPTS_APPEND #1394

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package io.quarkus.test.services.containers;

import java.util.Optional;

import org.apache.commons.lang3.StringUtils;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy;
Expand Down Expand Up @@ -40,8 +38,10 @@ protected GenericContainer<?> initContainer() {
}

container.withCreateContainerCmdModifier(cmd -> cmd.withName(DockerUtils.generateDockerContainerName()));
container.withCreateContainerCmdModifier(cmd -> Optional.ofNullable(cmd.getHostConfig())
.ifPresent(config -> config.withMemory(convertMiBtoBytes(model.getMemoryLimitMiB()))));

// Currently, we can't properly set the container's memory limit when running with Podman.
// More details on this issue can be found here: https://github.com/quarkus-qe/quarkus-test-suite/issues/2106
container.withEnv("JAVA_OPTS_APPEND", String.format("-XX:MaxRAM=%sm", model.getMemoryLimitMiB()));

if (isReusable()) {
Log.info(model.getContext().getOwner(), "Running container on Reusable mode");
Expand Down