Support Docker Compose in AOT-processed tests - #51287
Open
goutamadwant wants to merge 1 commit into
Open
Conversation
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>
goutamadwant
force-pushed
the
fix-docker-compose-aot-tests
branch
from
August 6, 2026 03:24
0f8211b to
f398093
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-cachePostgresIntegrationTestswithspring.aot.enabled=true