zonkyio / embedded-database-spring-test

A library for creating isolated embedded databases for Spring-powered integration tests.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DockerClientProviderException

mhlmhlmhlmhl opened this issue · comments

I'm getting this error when I run an integration test in our CI pipeline (on BitBucket), but all works fine when run on my laptop:

`TenantScopedEntityTest > initializationError FAILED java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:180

Caused by: org.springframework.beans.factory.BeanCreationException at AbstractAutowireCapableBeanFactory.java:1773
Caused by: jakarta.persistence.PersistenceException at AbstractEntityManagerFactoryBean.java:421
Caused by: io.zonky.test.db.shaded.com.google.common.util.concurrent.UncheckedExecutionException at Futures.java:1546
Caused by: io.zonky.test.db.provider.ProviderException at DockerPostgresDatabaseProvider.java:117
Caused by: java.lang.IllegalStateException at DockerClientProviderStrategy.java:277`

Following various suggestions, I have:

  • Added this to my application.yml file:
    zonky.test.database.postgres.docker.image: postgres:15.2 # Docker image containing PostgreSQL database. zonky.test.database.postgres.docker.tmpfs.enabled: false # Whether to mount postgres data directory as tmpfs. zonky.test.database.postgres.docker.tmpfs.options: rw,noexec,nosuid # Mount options used to configure the tmpfs filesystem.

  • Added a dependency: implementation "net.java.dev.jna:jna:5.14.0"

I am using Gradle 8.5 with jvm-test-suites and Java 17. My integration test dependencies are:

testIntegration(JvmTestSuite) { testType = TestSuiteType.INTEGRATION_TEST sources { java { srcDirs = ['src/testIntegration/java'] } } dependencies { implementation project() implementation "com.cayuse:cayuse-common:${cayuseCommonVersion}" implementation "io.zonky.test:embedded-database-spring-test:${zonkyEmbeddedDatabaseVersion}" implementation "org.springframework.boot:spring-boot-starter-data-jpa:${springBootVersion}" implementation "org.postgresql:postgresql:${postgresSqlVersion}" implementation "net.java.dev.jna:jna:${jnaVersion}" } targets { all { testTask.configure { shouldRunAfter(test) } } } }
The relevant portion of the gradle.properties file is:
cayuseCommonVersion=3.0.0 jnaVersion=5.14.0 postgresSqlVersion=42.7.2 springBootVersion=3.2.2 zonkyEmbeddedDatabaseVersion=2.5.0

My laptop (where the integration test works) is a Mac M3 Pro running Sonoma 14.1.2. The BitBucket pipeline (where the above error happens) is running on some AWS server.