From 07996b0ede6ebf749e603fff65afd94572a931be Mon Sep 17 00:00:00 2001 From: Priamo Germosen <6233424+pgermosen@users.noreply.github.com> Date: Wed, 18 Nov 2026 02:04:53 -0400 Subject: [PATCH] test: fold the Service Quotas applied-value profile into IndependentServiceSettingsProfile (#8834) Quarkus builds one application per distinct test profile at discovery and keeps each for the rest of the surefire JVM, so every profile a shard holds costs heap. ServiceQuotasAppliedValueIntegrationTest's nested profile sets the applied standard On-Demand vCPU quota, which only Service Quotas reports and EC2 only enforces with enforce-vcpu-quotas on, so it now shares IndependentServiceSettingsProfile, whose rule is one class per service setting. --- ...ServiceQuotasAppliedValueIntegrationTest.java | 16 ++++++---------- .../IndependentServiceSettingsProfile.java | 12 +++++++++--- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/test/java/io/floci/aws/services/servicequotas/ServiceQuotasAppliedValueIntegrationTest.java b/src/test/java/io/floci/aws/services/servicequotas/ServiceQuotasAppliedValueIntegrationTest.java index e92cfa9374..0630e19e6e 100644 --- a/src/test/java/io/floci/aws/services/servicequotas/ServiceQuotasAppliedValueIntegrationTest.java +++ b/src/test/java/io/floci/aws/services/servicequotas/ServiceQuotasAppliedValueIntegrationTest.java @@ -1,8 +1,8 @@ package io.floci.aws.services.servicequotas; +import io.floci.aws.testing.IndependentServiceSettingsProfile; import io.floci.aws.testing.RestAssuredJsonUtils; import io.quarkus.test.junit.QuarkusTest; -import io.quarkus.test.junit.QuarkusTestProfile; import io.quarkus.test.junit.TestProfile; import io.restassured.response.Response; import org.junit.jupiter.api.BeforeAll; @@ -10,7 +10,6 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; import java.util.List; -import java.util.Map; import static io.floci.aws.testing.EnforcementFixtures.auth; import static io.restassured.RestAssured.given; @@ -18,19 +17,16 @@ import static org.hamcrest.Matchers.equalTo; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; +/** + * GetServiceQuota reports a configured applied value. The value, 7, comes from + * {@link IndependentServiceSettingsProfile}. + */ @QuarkusTest -@TestProfile(ServiceQuotasAppliedValueIntegrationTest.AppliedQuotaProfile.class) +@TestProfile(IndependentServiceSettingsProfile.class) class ServiceQuotasAppliedValueIntegrationTest { private static final String CODE = "L-1216C47A"; - public static class AppliedQuotaProfile implements QuarkusTestProfile { - @Override - public Map getConfigOverrides() { - return Map.of("floci.services.servicequotas.standard-on-demand-vcpus", "7"); - } - } - @BeforeAll static void configureContentTypes() { RestAssuredJsonUtils.configureAwsContentTypes(); diff --git a/src/test/java/io/floci/aws/testing/IndependentServiceSettingsProfile.java b/src/test/java/io/floci/aws/testing/IndependentServiceSettingsProfile.java index 7f73d368c5..0de05d4f0c 100644 --- a/src/test/java/io/floci/aws/testing/IndependentServiceSettingsProfile.java +++ b/src/test/java/io/floci/aws/testing/IndependentServiceSettingsProfile.java @@ -68,6 +68,11 @@ import java.util.Map; * supported wire protocol claims, and leaves REST and well-formed RPC traffic untouched. * {@code StrictProtocolClaimingIntegrationTest} and {@code SwfLegacyProtocolIntegrationTest} rely * on it. + *
  • {@code floci.services.servicequotas.standard-on-demand-vcpus=7} is what GetServiceQuota + * reports as the applied value of the standard On-Demand vCPU quota. + * {@code ServiceQuotasAppliedValueIntegrationTest} relies on it. EC2 only enforces that quota + * when {@code floci.services.ec2.enforce-vcpu-quotas} is on, which it is not here, so + * {@code Ec2VolumeBlockDeviceDockerIntegrationTest}'s instances never meet it.
  • * * *

    Each override is inert for the other classes. Each one is read by a single service: the @@ -75,8 +80,8 @@ import java.util.Map; * Neptune cluster creation, Route53 VPC association and authorization, CloudFront origin fetches, * Cognito app client validation, the Scheduler dispatcher, the RDS Data API and Aurora auto-pause, * Firehose delivery, the Lambda runtime image resolver, the IoT MQTT broker, EC2, SageMaker - * training jobs, Bedrock Runtime and ElastiCache. Each class is the only one here that calls its - * service, so no override reaches another class. Strict claiming is read for every request, but + * training jobs, Bedrock Runtime, ElastiCache and Service Quotas. Each class is the only one here + * that calls its service, so no override reaches another class. Strict claiming is read for every request, but * only changes the answer to an RPC-signaled request no protocol claims, which only the two * protocol classes send. Route53 and RDS do look VPCs and subnets up in EC2, but only * read what EC2 has stored, which does not change with EC2 mocked or not. @@ -121,7 +126,8 @@ public class IndependentServiceSettingsProfile implements QuarkusTestProfile { Map.entry("floci.services.bedrock-runtime.proxy.url", "not a valid url"), Map.entry("floci.services.bedrock-runtime.proxy.passthrough", "true"), Map.entry("floci.services.elasticache.shell-less-backend", "true"), - Map.entry("floci.protocols.strict-claiming", "true"))); + Map.entry("floci.protocols.strict-claiming", "true"), + Map.entry("floci.services.servicequotas.standard-on-demand-vcpus", "7"))); overrides.putAll(new YamlConfigSource("runtime-images", """ floci: services: