mirror of https://github.com/jackc/pgx.git
Clean shutdown after the flush lsn check
parent
76ac06083e
commit
be5a9a0aff
|
@ -151,25 +151,14 @@ func TestSimpleReplicationConnection(t *testing.T) {
|
||||||
}
|
}
|
||||||
replicationConn.SendStandbyStatus(status)
|
replicationConn.SendStandbyStatus(status)
|
||||||
|
|
||||||
if replicationConn.IsAlive() == false {
|
|
||||||
t.Errorf("Connection died: %v", replicationConn.CauseOfDeath())
|
|
||||||
}
|
|
||||||
|
|
||||||
err = replicationConn.Close()
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("Replication connection close failed: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if replicationConn.IsAlive() == true {
|
|
||||||
t.Errorf("Connection still alive: %v", replicationConn.CauseOfDeath())
|
|
||||||
}
|
|
||||||
|
|
||||||
restartLsn := getConfirmedFlushLsnFor(t, conn, "pgx_test")
|
restartLsn := getConfirmedFlushLsnFor(t, conn, "pgx_test")
|
||||||
integerRestartLsn, _ := pgx.ParseLSN(restartLsn)
|
integerRestartLsn, _ := pgx.ParseLSN(restartLsn)
|
||||||
if integerRestartLsn != maxWal {
|
if integerRestartLsn != maxWal {
|
||||||
t.Fatalf("Wal offset update failed, expected %s found %s", pgx.FormatLSN(maxWal), restartLsn)
|
t.Fatalf("Wal offset update failed, expected %s found %s", pgx.FormatLSN(maxWal), restartLsn)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
closeReplicationConn(t, replicationConn)
|
||||||
|
|
||||||
replicationConn2 := mustReplicationConnect(t, *replicationConnConfig)
|
replicationConn2 := mustReplicationConnect(t, *replicationConnConfig)
|
||||||
defer closeReplicationConn(t, replicationConn2)
|
defer closeReplicationConn(t, replicationConn2)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue