Questions tagged [embedded-postgres]

13 questions
4
votes
1 answer

Why should I wait for `isBound` when allocating random socket in Java?

Recently I had an issue with embedded-postgres library. I tried to manually pick a free port via new ServerSocket(0).getLocalPort() but I was hitting a race condition somewhere (my tests hanged on the second test suite startup). Then I learned that…
Krever
  • 1,371
  • 1
  • 13
  • 32
3
votes
1 answer

Is Zonky embedded database supported for Spring boot 3.0 version?

I am trying to migrate my application from spring boot 2.7.2 to 3.0.0 version. On running integration test case, I am getting below error : java.lang.NullPointerException: Cannot invoke…
neha
  • 31
  • 3
2
votes
0 answers

How to run Spring Reactive integration tests using EmbeddedPostgres

I created a Spring reactive based Controller/repository and use r2dbc-postgresql driver. Previously, for testing classical Spring boot REST service I use EmbeddedPostgres. I tried to add the same for the reactive based controller but instead of…
StanislavL
  • 56,971
  • 9
  • 68
  • 98
2
votes
0 answers

Issue with read-only embedded postgres DB using spring boot and flyway migrations

Use case I am trying to have 2 datasources in my application. One for read-only connection and another for read-write connection. Configuration I have configured my JPA repositories to use different connections. In my IT case, I have the following…
1
vote
1 answer

Running spring boot integration tests with embedded postgres on Mac OS

I've recently moved over to Mac OS (M1 ARM64 processor) for development and managed to get most things working on my current project (spring boot with postgres), however the integration tests are causing issues. I'm using embedded-postgres with…
Duane Allman
  • 531
  • 2
  • 6
  • 20
1
vote
0 answers

SpringBootTest failed to load ApplicationContext due to 'Mapped port can only be obtained after the container is started'

I am using org.testcontainers:postgresql:1.17.2 for my integration tests. I also use io.zonky.test:embedded-database-spring-test:2.1.1 for unit tests that require a repository. A database-related part of application-it.yml spring: main: …
1
vote
0 answers

otj-pg-embedded > Embedded PostgreSQL > ERROR: syntax error at or near "PROCEDURE"

I am facing an issue when I'm trying to create a PROCEDURE using EmbeddedPostgres Rest everything is working except for when I'm trying to create a PROCEDURE Please find below the code. EmbeddedPostgres pg =…
0
votes
0 answers

Programmatically register EmbeddedDatabaseAutoConfiguration bean inside BeanDefinitionRegistryPostProcessor to use embedded Postgres

I am registering a bean for EmbeddedDatabaseAutoConfiguration but it is never acted upon. Is something missing for it to be processed in the same manner as if the annotation was present? I'd like to not have to declare the…
bobbyrne01
  • 6,295
  • 19
  • 80
  • 150
0
votes
2 answers

TypeError: 'NoneType' object is not subscriptable while using fetchone()

cur.execute(""" CREATE TEMPORARY VIEW bobby_view AS SELECT heading1, heading2 FROM bobby WHERE heading2 = %s; """, (variable,)) cur.execute(""" SELECT d1.heading1 …
0
votes
0 answers

CurrVal function returns null in Postgres embedded db

I am trying to use currVal function in postgres embedded db to get the value I have inserted in an insert statement in the same session. Please find the below code for the same. Student Table Definition: CREATE TABLE student ( id bigserial NOT…
0
votes
1 answer

Embedded Postgres cannot obtain process PID on Mac OS

I'm using embedded PostgreSQL with Java 11 for integration testing. On Windows it runs fine, but on Mac it first downloads Mac OS binaries (which is expected): Extract /Users/fubar/.embedpostgresql/postgresql-11.1-1-osx-binaries.zip START But then…
xuesheng
  • 3,396
  • 2
  • 29
  • 38
0
votes
0 answers

Why are my Postgres integration tests suddenly throwing an exception?

Last week, my integration tests were running fine. Today, this exception consistently gets thrown before my tests get run: org.postgresql.util.PSQLException: FATAL: could not open file "base/12669/2601": No such file or directory at…
dave4420
  • 46,404
  • 6
  • 118
  • 152
-1
votes
1 answer

Failed to read postmaster.pid file while running embedded-postgres

My Spring application uses yandex-qatools/postgresql-embedded for executing Unit Tests. While executing them, I am constantly getting the below error : ERROR 75847 --- [ Test worker] r.y.q.embed.postgresql.PostgresProcess : Failed to read PID…
Tanay Mathur
  • 379
  • 2
  • 5
  • 16