Files
floci/src/test/resources/application.yml
T
Allen Sanborn 67f06c3ac9 feat(cloudformation): list a deleted stack and report its DeletionTime (#4246)
* feat(cloudformation): list a deleted stack and report its DeletionTime

A deleted stack is already retained so DescribeStacks and DescribeStackEvents
keep answering for it by stack id after the delete, but the record they answer
with was incomplete in two ways.

It carried no deletion time, so DescribeStacks reported DELETE_COMPLETE with
nothing saying when. Stack now has a deletionTime, set as the stack reaches
DELETE_COMPLETE from the same service clock the retention window uses, and the
query handler emits DeletionTime wherever AWS does.

ListStacks omitted deleted stacks entirely. AWS keeps one there as
DELETE_COMPLETE long after DescribeStacks has stopped answering for it by name,
which is how a client reconciles what it deployed against what is left, and a
StackStatusFilter of DELETE_COMPLETE selects exactly those. Retained stacks are
now merged into the listing, still scoped to the caller's account and region and
still dropped once the window passes. A name reused after a delete lists twice,
once per stack id, as it does on AWS. Resource Explorer reads the live map
directly and is unaffected.

Restores deleted-stack-retention-seconds to application.yml, which #849 dropped
in a merge: the knob kept working on its @WithDefault, but the repository YAML
is the source of truth for what a deployment actually runs. Pinned in the test
YAML too, since the retention tests advance the clock past that exact window.

Nothing here changes how a delete runs, and it does not make a multi-stack cdk
destroy work: that client polls a destroy entirely by stack name, so a record
retained by stack id, these two members included, never enters its path.
DeleteStack does already return before the delete finishes, and the stack does
pass through DELETE_IN_PROGRESS, but the whole delete completes in roughly 15ms,
well inside one poll interval, so a client that starts watching when it issues
the delete finds the stack gone by name on its first poll. Giving a deleting
stack an observable window is separate work.

* fix(cloudformation): set a stack's deletion time before publishing the status

Stack.status is volatile and is documented as the publishing write of a deploy:
a reader that observes a terminal status is guaranteed to observe every write
that preceded it. deletionTime was assigned after it, outside that guarantee, so
a DescribeStacks running concurrently with the last step of a delete could
observe DELETE_COMPLETE while deletionTime was still null and answer with no
DeletionTime element at all.

Assigning it first puts it inside the same happens-before edge as the rest of
the delete. The window is nanoseconds wide and no test can land in it reliably,
so this carries none; the ordering rule is the thing being fixed, and the
comment records it so the next edit here keeps it.

* fix(cloudformation): retain a deleted stack before it leaves the live map

The handover at the end of a delete removed the stack from the live map, wrote
its removal through to storage, and only then retained it as deleted. A
ListStacks landing between the removal and the retention found it in neither
map and dropped it from the listing, though the stack both existed a moment ago
and is retained a moment later.

Retaining before removing closes that window. The stack is then briefly in both
maps, which is harmless: they hold the same Stack, and listStacks now reduces by
stack id, so it is listed exactly once throughout. Nothing else reads both maps,
since resolveStackForDescribe consults the retained one only after the live
lookup has missed.

Greptile reported the listing could also show the stack twice. It could not:
the old order removed before it inserted, so the two maps never overlapped. The
duplicate only becomes possible with this ordering, which is why the reduction
comes with it.

The test drives 60 deletes with four concurrent listings each. It fails on every
run against the old ordering and passes on every run against this one. It pins
the retention window open through a profile: the window is measured on the test
MutableClock, which advances on every read, and the pollers would otherwise
expire the retained record themselves.

* style(cloudformation): order the Stream import with the rest of java.util

java.util.stream.Stream landed between java.util.regex and java.util.concurrent
when it was added. It now follows both, the order AGENTS.md asks for. Only the
line this branch introduced moves; the block's older irregularities are left
where they are.

* fix(cloudformation): read the live stacks before creating the deleted-stack view

Retaining a stack before removing it keeps it in at least one map at every
instant, but listStacks built both of its views up front, the retained one
first and the live one after. A ConcurrentHashMap view reflects the table at
some point at or since its own creation and is not guaranteed to reflect a
modification made after it, so the retained view, created before the retain,
need never show the stack, while the live view, created after the remove, can
already miss it. A listing landing there loses the stack in both, which is the
window the retain-before-remove ordering was meant to close. Traversing the
retained view second does not help: creation bounds the guarantee, not
traversal.

The maps are now read one after the other instead of through a concatenated
pipeline, the live one first and in full, so the retained view is created after
any remove the live pass could have missed, and therefore after the retain that
preceded it. The reduction by stack id stays: the overlap it covers is real.

No test. The fault is the absence of a JDK guarantee rather than a behaviour:
these views do in practice reflect a later put, so the old ordering passes every
time and nothing can force it not to. The existing listing-race test still
covers the retain-before-remove ordering this rests on.

The java.util.stream.Stream import goes with Stream.concat, which the change
removes.

* test(cloudformation): stop the listing-race pollers on every exit path

The pollers were stopped after awaitDeleted returned, so a throw from the delete
or the wait left four non-daemon threads spinning on listStacks for the rest of
the run. That holds the test JVM open and buries the failure that caused it
under a hang, which is a far worse thing to debug than the failure itself.

Shutdown moves into a finally, so a failing delete stops them on its way out.
Each join is bounded and a thread still alive afterwards is interrupted and
recorded, with the poller loop now checking its own interrupt flag so that
interrupt is not merely decorative. The check that they all stopped is asserted
after the try and never inside the finally, where it would replace whatever the
delete threw with its own failure. The threads are daemons as a backstop, so a
future edit that throws somewhere nothing throws today still cannot wedge the
suite.

Also replaces an assertTrue(false, ...) in the wait helper with fail(...), which
says the same thing and reads as what it is. Noted here rather than slipped in.
2026-09-23 18:01:55 -05:00

530 lines
13 KiB
YAML

quarkus:
http:
port: 0
test-port: 0
# Integration signatures use localhost as the public test authority. Keep the test listener
# explicit so the production loopback default does not change the signed host.
host: 0.0.0.0
limits:
max-body-size: ${floci.protocols.max-request-size}M
# Groovy (a REST Assured dependency) starts DFA-cache-cleaner threads that never stop.
# Loaded parent-first they live in the shared system classloader, so they cannot pin a
# per-profile application classloader across the many app restarts of a test run.
class-loading:
parent-first-artifacts: org.apache.groovy:groovy
floci:
base-url: "http://localhost:4566"
network:
security-group-enforcement:
enabled: true
helper-image: floci/network-helper:local
default-region: us-east-1
default-account-id: "000000000000"
ai-mock-config-file: ${AI_MOCK_CONFIG:src/test/resources/fixtures/ai-mock-config.json}
storage:
mode: memory
persistent-path: ./target/test-data
prune-volumes-on-delete: true
wal:
compaction-interval-ms: 60000
services:
ssm:
flush-interval-ms: 60000
dynamodb:
flush-interval-ms: 60000
sns:
flush-interval-ms: 60000
lambda:
flush-interval-ms: 60000
cloudwatchlogs:
flush-interval-ms: 60000
cloudwatchmetrics:
flush-interval-ms: 60000
secretsmanager:
flush-interval-ms: 60000
acm:
flush-interval-ms: 60000
opensearch:
flush-interval-ms: 60000
sagemaker:
flush-interval-ms: 60000
batch:
flush-interval-ms: 60000
lightsail:
flush-interval-ms: 60000
codepipeline:
flush-interval-ms: 60000
s3vectors:
flush-interval-ms: 60000
s3tables:
flush-interval-ms: 60000
ecs:
flush-interval-ms: 60000
codebuild:
flush-interval-ms: 60000
config:
flush-interval-ms: 60000
transcribe:
flush-interval-ms: 60000
codedeploy:
flush-interval-ms: 60000
tagging:
flush-interval-ms: 60000
elasticbeanstalk:
flush-interval-ms: 60000
cloudfront:
appsync:
flush-interval-ms: 60000
rum:
flush-interval-ms: 60000
resourceexplorer2:
mode: memory
flush-interval-ms: 60000
fis:
flush-interval-ms: 60000
guardduty:
flush-interval-ms: 60000
emrserverless:
flush-interval-ms: 60000
lakeformation:
flush-interval-ms: 60000
auth:
validate-signatures: false
presign-secret: test-secret
security:
extra-cors-allowed-origins: ${EXTRA_CORS_ALLOWED_ORIGINS:}
extra-cors-allowed-headers: ${EXTRA_CORS_ALLOWED_HEADERS:}
extra-cors-expose-headers: ${EXTRA_CORS_EXPOSE_HEADERS:}
disable-cors-headers: false
# The test listener binds all interfaces so Quarkus keeps localhost as its test authority.
# This is test-only; production keeps the loopback default.
allow-unsafe-network-exposure: true
allow-private-jwt-targets: true
init-hooks:
shell-executable: /bin/sh
timeout-seconds: 5
shutdown-grace-period-seconds: 2
tls:
enabled: false
self-signed: true
protocols:
strict-claiming: false
reject-unknown-service-scope: true
docker:
log-max-size: "10m"
log-max-file: "3"
resource-namespace: ""
services:
ssm:
enabled: true
max-parameter-history: 5
sqs:
enabled: true
default-visibility-timeout: 30
max-message-size: 1048576
s3:
enabled: true
enforce-auth: false
default-presign-expiry-seconds: 3600
global-bucket-namespace: false
dynamodb:
enabled: true
vector-index-allocation-seconds: 0
vector-index-backfill-seconds: 0
sns:
enabled: true
lambda:
enabled: true
docker-flags: ""
honour-architectures: false
zip-max-entries: 100000
# aws-config-path:
hot-reload:
enabled: true
apigateway:
enabled: true
vtl-max-loops: 10000
vtl-max-output-chars: 1048576
vtl-timeout-millis: 5000
apigatewayv2:
enabled: true
iam:
enabled: true
enforcement-enabled: false
seed-deployer-principal: false
msk:
enabled: true
mock: true
default-image: "redpandadata/redpanda:latest"
amazonmq:
enabled: true
mock: true
amqp-host-port-base: 5672
amqp-host-port-max: 5699
console-host-port-base: 15672
console-host-port-max: 15699
kinesis-analytics:
enabled: true
mock: true
elasticache:
enabled: true
proxy-base-port: 6379
proxy-max-port: 6399
default-image: "valkey/valkey:8"
default-memcached-image: "memcached:1.6"
memorydb:
enabled: true
mock: false
proxy-base-port: 6400
proxy-max-port: 6419
default-image: "valkey/valkey:8"
redshift:
enabled: true
default-port: 5439
image-version: postgres:15-alpine
poll-interval-ms: 1000
proxy-base-port: 7100
proxy-max-port: 7199
default-credential-duration-seconds: 900
proxy-handshake-timeout-millis: 10000
proxy-backend-connect-timeout-millis: 5000
proxy-max-connections: 100
rds:
enabled: true
mock: false
proxy-base-port: 7001
proxy-max-port: 7099
default-sql-server-image: "mcr.microsoft.com/mssql/server:2022-latest"
proxy-handshake-timeout-millis: 10000
proxy-backend-connect-timeout-millis: 5000
proxy-max-connections: 100
aurora-auto-pause-enabled: true
aurora-resume-delay-millis: 0
rds-data:
enabled: true
transaction-ttl-seconds: 180
redshift-data:
enabled: true
result-ttl-hours: 24
redshift-serverless:
enabled: true
neptune:
enabled: true
proxy-base-port: 8182
proxy-max-port: 8282
default-image: "tinkerpop/gremlin-server:3.7.3"
eventbridge:
enabled: true
cloudmap:
enabled: true
emr:
enabled: true
wafv2:
enabled: true
scheduler:
enabled: true
cloudwatchlogs:
enabled: true
max-events-per-query: 10000
cloudwatchmetrics:
enabled: true
secretsmanager:
enabled: true
default-recovery-window-days: 30
kinesis:
enabled: true
list-shards-next-token-ttl-millis: 300000
firehose:
enabled: true
tick-interval-seconds: 10
flush-record-count: 0
staging-bucket: floci-firehose-staging
kms:
enabled: true
cognito:
enabled: true
stepfunctions:
enabled: true
allow-plaintext-http: true
mock-config-file: ${SFN_MOCK_CONFIG:src/test/resources/fixtures/sfn-mock-config.json}
max-wait-seconds: 30
swf:
enabled: true
timeout-sweep-enabled: true
timeout-sweep-interval-seconds: 1
cloudformation:
enabled: true
# Pinned to the shipped default: the retention tests advance the test clock past this
# window by name, so the value they assume is spelled out rather than inherited.
deleted-stack-retention-seconds: 30
# Fail an AWS::Lambda::Function whose S3 code cannot be read, as real CloudFormation
# does. Set true to fall back to the built-in stub handler instead (issue #2648).
allow-stub-lambda-code: false
# Pinned to the shipped default so a test sees what a user sees; the strict-mode test
# overrides it with its own profile.
allow-stub-unsupported-resource-types: true
acm:
enabled: true
validation-wait-seconds: 0
athena:
enabled: true
mock: true
glue:
enabled: true
ses:
enabled: true
opensearch:
enabled: true
mock: true
proxy-base-port: 9400
proxy-max-port: 9499
ec2:
# Optional complete catalog override for locally built guest images.
image-catalog-path: ${FLOCI_SERVICES_EC2_IMAGE_CATALOG_PATH:}
enabled: true
imds-port: 9169
ssh-port-range-start: 2200
ssh-port-range-end: 2299
publish-security-group-ports: true
app-port-range-start: 30000
app-port-range-end: 30999
max-published-ports-per-instance: 20
socat-image: alpine/socat
mock: true
instance-resource-limits: true
aws-faithful-private-ip: false
# container-ips-routable: true # see src/main/resources/application.yml
# Off explicitly, not merely by implication of mock: true above. Tests must not create or
# reconcile Docker networks on whatever daemon CI happens to have.
vpc-networks:
enabled: false
ecs:
enabled: true
mock: true
host-volume-roots: []
allow-unsafe-host-volumes: false
appconfig:
enabled: true
appconfigdata:
enabled: true
ecr:
enabled: true
tls-uri: false
ui:
enabled: true
bedrock:
enabled: true
bedrock-runtime:
enabled: true
eks:
enabled: true
mock: true
ecr-registry-mirror: true
imds: false
irsa-signing-key: true
mwaa:
enabled: true
mock: true
pipes:
enabled: true
elb:
enabled: true
mock: true
elbv2:
enabled: true
mock: true
codebuild:
enabled: true
# docker-network: floci-network
sagemaker:
enabled: true
# docker-network: floci-network
gpu:
# Off by default: an existing deployment keeps launching CPU-only
# containers. How many GPUs an ml.* type has is shipped in
# sagemaker/instance-type-catalog.yaml; this is only about which of
# this machine's devices Floci may hand out.
enabled: false
# cdi | device-ids | count. Podman resolves only cdi, and accepts
# count while attaching no device, so cdi fails loudly instead.
mode: cdi
# Required for cdi and device-ids modes; unset allows no device.
# devices:
# - nvidia.com/gpu=GPU-<uuid>
batch:
enabled: true
runner-mode: immediate
codedeploy:
enabled: true
codepipeline:
enabled: true
autoscaling:
enabled: true
applicationautoscaling:
enabled: true
elasticbeanstalk:
enabled: true
transfer:
enabled: true
backup:
enabled: true
job-completion-delay-seconds: 1
fis:
enabled: true
route53:
enabled: true
textract:
enabled: true
comprehend:
enabled: true
rekognition:
enabled: true
translate:
enabled: true
pricing:
enabled: true
ce:
enabled: true
cur:
enabled: true
emit-mode: off
bcm-pricing-calculator:
enabled: true
timestream-influxdb:
enabled: true
mock: true
bcm-data-exports:
enabled: true
emit-mode: off
oam:
enabled: true
cloudtrail:
enabled: true
flush-interval-seconds: 3600
lightsail:
enabled: true
cloudcontrol:
enabled: true
resourceexplorer2:
enabled: true
cloudfront:
enabled: true
allowed-private-origin-hosts: []
appsync:
enabled: true
schema-worker-threads: 4
schema-worker-shutdown-timeout-seconds: 30
vtl-max-loops: 10000
vtl-max-output-chars: 1048576
vtl-timeout-millis: 5000
s3vectors:
enabled: true
s3tables:
enabled: true
iot:
enabled: true
rule-sql-strict: false
mqtt:
enabled: true
auto-start: false
host: 127.0.0.1
port: 1883
tls-port: 8883
iotdata:
enabled: true
cloudhsmv2:
enabled: true
efs:
enabled: true
organizations:
enabled: true
rum:
enabled: true
networkfirewall:
enabled: true
servicecatalog:
enabled: true
guardduty:
enabled: true
emrserverless:
enabled: true
ssoadmin:
enabled: true
ssooidc:
enabled: true
local-principal-id: ${FLOCI_SERVICES_SSOOIDC_LOCAL_PRINCIPAL_ID:}
macie2:
enabled: true
account:
enabled: true
controlcatalog:
enabled: true
accessanalyzer:
enabled: true
identitystore:
enabled: true
scim-bearer-token: ${FLOCI_SERVICES_IDENTITYSTORE_SCIM_BEARER_TOKEN:floci-scim-token}
budgets:
enabled: true
inspector2:
enabled: true
securityhub:
enabled: true
detective:
enabled: true
controltower:
enabled: true
seed-landing-zone: true
route53resolver:
enabled: true
connect:
enabled: true
appintegrations:
enabled: true
cognitoidentity:
enabled: true
globalaccelerator:
enabled: true
datasync:
enabled: true
aps:
enabled: true
lakeformation:
enabled: true
tagging:
enabled: true
configservice:
enabled: true
transcribe:
enabled: true
docdb:
enabled: true
mock: false
default-image: "mongo:7.0"
bedrock-agent-core:
enabled: true
bedrock-agent-core-control:
enabled: true
servicequotas:
enabled: true
verifiedpermissions:
enabled: true
ram:
enabled: true
codegurureviewer:
enabled: true
codeartifact:
enabled: true
marketplace:
enabled: true
dms:
enabled: true