ActiveRecord::ConnectionNotEstablished: PQsocket() can't get socket descriptor

Since yesterday we suddenly get PQsocket errors on (almost) all of our system tests for one of our applications. The exact error is:

ActiveRecord::ConnectionNotEstablished:
       PQsocket() can't get socket descriptor

We are using Ruby (3.3) on Rails (7.1) with Rspec (3.13) and pg (1.5.9) and PostgreSQL 16.4.

We found the solution in PG::ConnectionBad: PQsocket() can't get socket descriptor and tried that already, but with no result unfortunately :frowning:

Anybody has an idea on how to fix this?