Light, fluffy, and always free - The AWS Local Emulator alternative
test(eks): let the IMDS and pod identity test containers exit on SIGTERM (#4228)
Priamo Germosenacafe73a2c21
diff --git a/src/test/java/io/github/hectorvent/floci/services/eks/EksImdsDockerIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/eks/EksImdsDockerIntegrationTest.javaindex afb55bfdc1..47ac97bc24 100644--- a/src/test/java/io/github/hectorvent/floci/services/eks/EksImdsDockerIntegrationTest.java+++ b/src/test/java/io/github/hectorvent/floci/services/eks/EksImdsDockerIntegrationTest.java@@ -108,7 +108,9 @@ class EksImdsDockerIntegrationTest {.withName("floci-eks-imds-test-" + clusterName).withPrivileged(true).withHostDockerInternalOnLinux()- .withCmd(List.of("sleep", "300"))+ // PID 1 gets no default SIGTERM handler, so a bare "sleep 300" sits out the+ // whole stopAndRemove grace period when @AfterEach tears the container down.+ .withCmd(List.of("sh", "-c", "trap 'exit 0' TERM; sleep 300 & wait")).build();containerId = lifecycleManager.createAndStart(spec).containerId();diff --git a/src/test/java/io/github/hectorvent/floci/services/eks/EksPodIdentityDockerIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/eks/EksPodIdentityDockerIntegrationTest.javaindex aedc52b524..8b512e3093 100644--- a/src/test/java/io/github/hectorvent/floci/services/eks/EksPodIdentityDockerIntegrationTest.java+++ b/src/test/java/io/github/hectorvent/floci/services/eks/EksPodIdentityDockerIntegrationTest.java@@ -154,7 +154,9 @@ class EksPodIdentityDockerIntegrationTest {.withName("floci-eks-pi-test-" + clusterName).withPrivileged(true).withHostDockerInternalOnLinux()- .withCmd(List.of("sleep", "300"))+ // PID 1 gets no default SIGTERM handler, so a bare "sleep 300" sits out the+ // whole stopAndRemove grace period when @AfterEach tears the container down.+ .withCmd(List.of("sh", "-c", "trap 'exit 0' TERM; sleep 300 & wait")).build();containerId = lifecycleManager.createAndStart(spec).containerId();