embedded-database-spring-test: macOs Big Sur: ERROR: checkpoint request failed

Getting Failed to load ApplicationContext when running multiple tests together after macOS update to Big Sur. When running just one test then everything usually works the first time after restarting the computer, but later the error starts to occur even with running just one test.

Caused by: org.postgresql.util.PSQLException: ERROR: checkpoint request failed at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2532) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2267) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:312) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:448) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:369) at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:153) at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:142) at io.zonky.test.db.provider.impl.ZonkyPostgresDatabaseProvider$DatabaseInstance$DatabaseTemplate.executeStatement(ZonkyPostgresDatabaseProvider.java:163) at io.zonky.test.db.provider.impl.ZonkyPostgresDatabaseProvider$DatabaseInstance$DatabaseTemplate.createDatabase(ZonkyPostgresDatabaseProvider.java:156) at io.zonky.test.db.provider.impl.ZonkyPostgresDatabaseProvider.getDatabase(ZonkyPostgresDatabaseProvider.java:94) at io.zonky.test.db.provider.impl.PrefetchingDatabaseProvider$PrefetchingTask.lambda$new$0(PrefetchingDatabaseProvider.java:252) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at io.zonky.test.db.provider.impl.PrefetchingDatabaseProvider$PrefetchingTask.run(PrefetchingDatabaseProvider.java:259) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ... 1 more

Updated to 1.6.1 to resolve a different issue on Big Sur, but this one still remains.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 1
  • Comments: 40

Most upvoted comments

In my opinion, the best practice is to use Google …

I also have Eset and when real-time file system protection is disabled then the problem doesn’t seem to appear - as soon as it’s enabled then the issue occurs again.

Hit the same error on Big Sur. It looks like the wait for datasource isn’t working: I had one setup with ~7 tests of which the first 3 where failing. Depending on timing, sometimes all worked, sometimes not.

I created a git repo with a minimal setup for reproduction: https://github.com/dirkbolte/flyway_zonky

Here is my tested and working solution:

  1. Make sure you have Docker installed and it was started
  2. Make sure you have org.testcontainers:postgresql added to the dependencies. I have the following dependencies in my gradle.build file.
    testImplementation 'io.zonky.test:embedded-database-spring-test:1.6.3'
    testImplementation 'org.testcontainers:postgresql:1.15.1'
  1. You can do few things on your local a. Add this to your command line while you are running your tests: -Dzonky.test.database.provider=DOCKER b. You can add this to your ~/.gradle/gradle.properties or gradle.properties of your project: systemProp.zonky.test.database.provider=DOCKER

This is going to fix test running with embedded Postgres on your local. This will not impact your CI process because it will continue to use the default settings. Of course you have to take care of those settings if you have similar problems in that environment but definitely this will solve the problems transparently on your local development environment.

Нет, это системное свойство, поэтому его необходимо передать в начале java-процесса. Если вы используете Maven, вы можете установить его в конфигурации плагина Surefire или Failsafe. Подробные инструкции находятся здесь: https://maven.apache.org/surefire/maven-surefire-plugin/examples/system-properties.html .

and what about gradle ? what would be the best practice ?

create or locate gradle.properties file in your project folder. Add this line.

systemProp.ot.epg.working-dir=/home/xxx/embedded-pg

Note that, I did not test this suggestion yet. You can find more description about gradle.properties here: https://docs.gradle.org/current/userguide/build_environment.html

Maybe your antivirus performs some type of scan even after turning off the realtime shield. I’m just guessing, I can’t verify, I couldn’t reproduce the problem.

Is there anyone who doesn’t use antivirus at all and is facing with the same issues?

I have AVG. With ‘File Shield’ on it consistently fails with it off it consistently works!

Thanks very much for your investigation and insight @tomix26!