Skip to content

Support Docker Compose in AOT-processed tests - #51287

Closed
goutamadwant wants to merge 1 commit into
spring-projects:mainfrom
goutamadwant:fix-docker-compose-aot-tests
Closed

Support Docker Compose in AOT-processed tests#51287
goutamadwant wants to merge 1 commit into
spring-projects:mainfrom
goutamadwant:fix-docker-compose-aot-tests

Conversation

@goutamadwant

@goutamadwant goutamadwant commented Aug 6, 2026

Copy link
Copy Markdown

Docker Compose support currently backs off during both AOT processing and execution using generated artifacts. Removing only the runtime backoff allows Compose connection details to be registered alongside fallback connection details captured in the generated context, resulting in duplicate beans.

This change identifies test AOT processing separately from application AOT processing. Docker Compose participates while test contexts are AOT-processed so that its connection details influence auto-configuration conditions, while application AOT processing continues to back off. Compose connection details created during test AOT processing are excluded from generated bean registrations and are registered again from the running services when the AOT-processed test executes.

Fixes #36273

Tests:

  • ./gradlew :core:spring-boot-docker-compose:check :core:spring-boot-test:check --no-build-cache
  • Petclinic PostgresIntegrationTests with spring.aot.enabled=true

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 6, 2026
Allow Docker Compose to participate in test AOT processing so that its connection details affect auto-configuration conditions. Exclude those runtime connection detail beans from generated registrations and recreate them when the AOT-processed test runs.

Keep Docker Compose disabled during application AOT processing.

Fixes spring-projectsgh-36273

Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
@wilkinsona

Copy link
Copy Markdown
Member

Thanks for the proposal. We can't introduce a spring.test.* system property in Spring Boot as that namespace is owned by spring-test. Furthermore, if there's a need to be able to distinguish general AOT processing and AOT processing of tests, that's something that should be dealt with in spring-test. Thanks anyway.

@wilkinsona wilkinsona closed this Sep 7, 2026
@wilkinsona wilkinsona added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: declined A suggestion or change that we don't feel we should currently apply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docker Compose support does not work in AOT-processed tests

3 participants