Closed rubengees closed 4 years ago
Please share your configuration for both tests, how you try to connect to containerized postgres
I have made these changes after removing h2:
// build.gradle
testImplementation "com.playtika.testcontainers:embedded-postgresql:$embeddedPostgresVersion"
testImplementation "org.springframework.cloud:spring-cloud-starter:$springCloudVersion"
# application.yaml
datasource:
url: "jdbc:postgresql://${embedded.postgresql.host}:${embedded.postgresql.port}/${embedded.postgresql.schema}"
username: ${embedded.postgresql.user}
password: ${embedded.postgresql.password}
# bootstrap.yaml
embedded:
postgresql:
dockerImage: timescale/timescaledb:latest-pg10
I can try to make a minimal sample project later if you like.
would be awesome, since settings seems to be good for me, just not sure about your image, can u try use default one?
Okay, will do that later. I can't try without since the application depends heavily on TimescaleDB. That is basically Postgres with an extension and should work (actually does if the tests are executed individually).
Here is an example project: https://github.com/rubengees/spring-boot-embedded-postgres
You were right, this only happens when using timescaledb! I saw that the GenericContainer
is used here instead of the PostgreSQLContainer
:
Later today I tried with the official PostgreSQL container and that worked, probably because of different status checks:
Would it make sense for this project to depend on the Postgres module?
ideally yes, we need to reuse vanilla containers, but not sure that we would have time for this in nearest future. Unless there will be more votes on this ticket. Anyways you are free to add PR, be sure that review process will be as short as possible, same as release.
@rubengees I guess this issue can be closed?
I have two test classes, one annotated with:
and the other annotated with:
Individually run, they both work fine. Once I start them together, the one executed later always fails with this error: