Skip to content

Support Docker Compose in AOT-processed tests - #51287

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

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docker Compose support does not work in AOT-processed tests

2 participants