Clean shutdown after the flush lsn check

pull/226/head
Kris Wehner 2017-01-30 14:12:12 -08:00
parent 76ac06083e
commit be5a9a0aff
1 changed files with 2 additions and 13 deletions

View File

@ -151,25 +151,14 @@ func TestSimpleReplicationConnection(t *testing.T) {
}
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")
integerRestartLsn, _ := pgx.ParseLSN(restartLsn)
if integerRestartLsn != maxWal {
t.Fatalf("Wal offset update failed, expected %s found %s", pgx.FormatLSN(maxWal), restartLsn)
}
closeReplicationConn(t, replicationConn)
replicationConn2 := mustReplicationConnect(t, *replicationConnConfig)
defer closeReplicationConn(t, replicationConn2)