From acafe73a2c2130b8f249156b7f02caefc160f1c2 Mon Sep 17 00:00:00 2001 From: Priamo Germosen <6233424+pgermosen@users.noreply.github.com> Date: Wed, 23 Sep 2026 19:08:25 -0400 Subject: [PATCH] test(eks): let the IMDS and pod identity test containers exit on SIGTERM (#4228) --- .../floci/services/eks/EksImdsDockerIntegrationTest.java | 4 +++- .../services/eks/EksPodIdentityDockerIntegrationTest.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) 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.java index 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.java index 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();