spring-projects / spring-projects/spring-boot

Docker Compose support does not work in AOT-processed tests

Open
#36,273 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

theme: aot type: bug
Dominant language
Java
Stars
81.5k
Forks
42.7k
Avg merge
2d 4h
Merged PRs (30d)
65

Description

This can be reproduced using Petclinic's tests with AOT enabled:

tasks.named('test') {
  useJUnitPlatform()
  systemProperty "spring.aot.enabled", true
}

./gradlew test fails with both tests in PostgresIntegrationTests failing as they could not connect to Postgres. They try to use the default host and port rather than those of a container starter by Docker Compose.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure in Spring Petclinic with the shown Gradle test configuration and AOT enabled. Start with the PostgresIntegrationTests and the Docker Compose container-starter integration, then trace why the tests use the default host and port; done means both tests connect to the Compose-managed Postgres instance under AOT.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker-compose, java, spring-boot
Domain
backend, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.