Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostgresIntegrationTests fails sometimes (maybe on a stale volume?) #1522

Open
dgraham10009 opened this issue Apr 23, 2024 · 4 comments
Open

Comments

@dgraham10009
Copy link

spring-petclinic PostgresIntegrationTests.testFindAll » IllegalState

remove PostgresIntegrationTests.java, no issue

@JamesGoodger
Copy link

+1 - only got when making the container however.

@dsyer
Copy link
Member

dsyer commented May 16, 2024

It fails for me when I have an old volume from a previous test run with an older version of postgres. Impossible to say if your problem is the same, but if it is you can just delete the volume (e.g. by docker compose rm postgres service). See spring-projects/spring-boot#38763 for progress on workarounds other than manually deleting.

@dsyer dsyer changed the title latest clone does not build PostgresIntegrationTests fails sometimes (maybe on a stale volume?) May 17, 2024
@slackingfred
Copy link

Don't know if this is the same issue as what you encountered, but I think it's good to share:

I noticed some peculiarity about this failure. That is, on Ubuntu 22.04/24.04:

  • If Docker isn't installed, build succeeds (because it skips test cases needing Docker)
  • If Docker is installed by APT, build fails with 2 test errors
  • If Docker is installed by Snap, build succeeds

The cause I identified: PostgreSQL test cases use docker compose (Compose v2) to set up its environment. This is bundled in the Snap version of Docker, but not in the APT version (even if you also installed the docker-compose package, you'll only get docker-compose (legacy compose), not docker compose. See https://docs.docker.com/compose/migrate/)

So my workaround is to ensure docker compose exists in environment before building. The solution should be more advanced detection of tools in the build script (e.g. skip PostgreSQL tests if docker compose is not present, with a warning), but I'm not familiar with Java or Maven, so I can't help on that.

@dsyer
Copy link
Member

dsyer commented Jul 16, 2024

Thanks for the detail. It’s not the same problem though, and Spring Boot explicitly requires the newer version of docker, so it’s kind of expected, I think (and also therefore not a problem with the Pet Clinic project). If the error you got wasn’t clear about what was wrong I would take it up with the Spring Boot project directly if I were you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants