test: run the Lambda leftover containers class on ScopedServiceSettingsProfile (#8887)

LambdaLeftoverContainersDockerIntegrationTest's nested profile set the
Lambda executor to docker, the default already, and a Docker resource
namespace of its own. ScopedServiceSettingsProfile names its containers
in this test JVM's sidecar namespace, which keeps the class's sweep away
from another Floci's containers just as well. The sweep removes only
Lambda environments, which no other class there starts, and the class
drives the launcher directly, so none of the ECS, CORS, partition or EC2
settings reaches it.
This commit is contained in:
Priamo Germosen authored and GitHub committed 2026-11-18 14:59:21 -04:00
1 parent 4453ca9fe9
commit 08e2824a2c
2 files changed
+11 -14

No files matched your search

@@ -9,9 +9,9 @@ import io.floci.aws.core.common.docker.ContainerLifecycleManager;
import io.floci.aws.core.common.docker.ContainerStorageHelper;
import io.floci.aws.services.lambda.model.LambdaFunction;
import io.floci.aws.testing.DockerAvailability;
import io.floci.aws.testing.ScopedServiceSettingsProfile;
import io.floci.aws.testing.TestImages;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.QuarkusTestProfile;
import io.quarkus.test.junit.TestProfile;
import jakarta.inject.Inject;
import org.junit.jupiter.api.Assumptions;
@@ -33,7 +33,7 @@ import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
@QuarkusTest
@TestProfile(LambdaLeftoverContainersDockerIntegrationTest.LeftoversProfile.class)
@TestProfile(ScopedServiceSettingsProfile.class)
class LambdaLeftoverContainersDockerIntegrationTest {
@Inject
@@ -126,12 +126,4 @@ class LambdaLeftoverContainersDockerIntegrationTest {
return false; // The sweep removed this exact test container.
}
}
public static final class LeftoversProfile implements QuarkusTestProfile {
@Override
public Map<String, String> getConfigOverrides() {
return Map.of("floci.docker.resource-namespace", "lambda-leftovers-7731",
"floci.services.lambda.executor", "docker");
}
}
}
@@ -24,7 +24,9 @@ import java.util.Map;
* tasks, so none needs the sweep. {@code floci.docker.resource-namespace} names their containers
* in this run's {@link SidecarContainersProfile#namespace() sidecar namespace}, so another test
* JVM on the same Docker daemon and port, whose startup sweep is on, never takes them for its own
* leftovers.</li>
* leftovers. {@code LambdaLeftoverContainersDockerIntegrationTest} relies on the namespace too:
* it sweeps the Lambda environments its deployment left on an earlier run, and the namespace,
* which only this test JVM uses, keeps that sweep away from another Floci's containers.</li>
* <li>{@code floci.services.ecs.host-volume-roots=/dev/null} makes {@code /dev/null} the one host
* path a device may take, since devices are refused by default, and
* {@code floci.services.ecs.allow-privileged-containers=true} lets a task definition ask for
@@ -41,9 +43,12 @@ import java.util.Map;
* them.</li>
* </ul>
*
* <p>Each is inert for the other classes. Only the three ECS classes run a task or any other
* container, so only their containers carry the namespace. Their tasks run in bridge mode, which security-group enforcement never protects, and
* only the Linux parameters class asks for a device or privilege. The pull on every launch reaches
* <p>Each is inert for the other classes. Only the three ECS classes and the Lambda leftovers class
* start containers, so only theirs carry the namespace. The leftovers class sweeps only Lambda
* environments, which no other class here starts, and drives the Lambda launcher directly, without
* sending a request, so none of the ECS, CORS, partition or EC2 settings reaches it. The ECS tasks
* run in bridge mode, which security-group enforcement never protects, and only the Linux
* parameters class asks for a device or privilege. The pull on every launch reaches
* the other two ECS classes' tasks too, and changes nothing they check: their busybox tasks run
* the same way on the image the tag names now, and a failed pull runs the cached image. Only
* {@code GlobalCorsFilterIntegrationTest} sends an {@code Origin} header, the only request the CORS