Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
test: fix drop replication slot on 9.4 for tests (#696)
Postgresql 9.4 doesn't have PID in pg_replication_slots view, so we can't terminate replication session. Instead of it, we wait until postgresql after `replicationConnection.close()` change replication slot status to not active. ``` testReplicationRestartFromLastFeedbackPosition(org.postgresql.replication.LogicalReplicationTest) Time elapsed: 0.038 sec <<< ERROR! org.postgresql.util.PSQLException: ERROR: column "active_pid" does not exist Position: 29 at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2480) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2180) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:294) at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:430) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:356) at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:303) at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:289) at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:266) at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:262) at org.postgresql.replication.LogicalReplicationTest.dropReplicationSlot(LogicalReplicationTest.java:97) at org.postgresql.replication.LogicalReplicationTest.tearDown(LogicalReplicationTest.java:84) ``` Current solution it's WA on bug describe in https://www.postgresql.org/message-id/CAFgjRd3hdYOa33m69TbeOfNNer2BZbwa8FFjt2V5VFzTBvUU3w%40mail.gmail.com * Add timeout on wait close replication slot
- Loading branch information
Showing
with
109 additions
and 87 deletions.
- +3 −28 pgjdbc/src/test/java/org/postgresql/replication/LogicalReplicationStatusTest.java
- +3 −27 pgjdbc/src/test/java/org/postgresql/replication/LogicalReplicationTest.java
- +2 −28 pgjdbc/src/test/java/org/postgresql/replication/PhysicalReplicationTest.java
- +2 −4 pgjdbc/src/test/java/org/postgresql/replication/ReplicationSlotTest.java
- +99 −0 pgjdbc/src/test/java/org/postgresql/test/TestUtil.java