test(ecs): let the Docker test containers exit on SIGTERM instead of sitting out stopTimeout (#4211)

This commit is contained in:
Priamo Germosen authored and GitHub committed 2026-09-23 00:59:57 -05:00
1 parent b10c02f5fe
commit 620d717653
2 files changed
+6 -2

No files matched your search

@@ -118,7 +118,9 @@ class EcsContainerManagerStatsDockerIntegrationTest {
ContainerDefinition definition = new ContainerDefinition();
definition.setName(name);
definition.setImage(BUSYBOX_IMAGE);
definition.setCommand(List.of("sleep", "60"));
// PID 1 gets no default SIGTERM handler, so a bare "sleep 60" sits out the whole
// stopTimeout grace period on teardown, once per container in the task.
definition.setCommand(List.of("sh", "-c", "trap 'exit 0' TERM; sleep 60 & wait"));
return definition;
}
@@ -67,7 +67,9 @@ class EcsExecChannelDockerIntegrationTest {
ContainerDefinition app = new ContainerDefinition();
app.setName("app");
app.setImage(BUSYBOX_IMAGE);
app.setCommand(List.of("sleep", "120"));
// PID 1 gets no default SIGTERM handler, so a bare "sleep 120" sits out the whole
// stopTimeout grace period on teardown.
app.setCommand(List.of("sh", "-c", "trap 'exit 0' TERM; sleep 120 & wait"));
TaskDefinition taskDefinition = new TaskDefinition();
taskDefinition.setFamily("exec-docker-" + suffix);