From b2f416c07d8ed08f4dc21602a9c57c6eb602a03d Mon Sep 17 00:00:00 2001 From: Kris Wehner Date: Mon, 9 Jan 2017 14:27:34 -0800 Subject: [PATCH] Drop replication slot has to run on a live connection, so we'll use the function form for the test. --- replication_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/replication_test.go b/replication_test.go index 42d133c4..20572edd 100644 --- a/replication_test.go +++ b/replication_test.go @@ -173,10 +173,6 @@ func TestSimpleReplicationConnection(t *testing.T) { t.Errorf("Unexpected write position %d", status.WalWritePosition) } - err = replicationConn.DropReplicationSlot("pgx_test") - if err != nil { - t.Fatalf("Failed to drop replication slot %v", err) - } err = replicationConn.Close() if err != nil { t.Fatalf("Replication connection close failed: %v", err) @@ -187,4 +183,10 @@ func TestSimpleReplicationConnection(t *testing.T) { if integerRestartLsn != maxWal { t.Fatalf("Wal offset update failed, expected %s found %s", pgx.FormatLSN(maxWal), restartLsn) } + + _, err = conn.Exec("select pg_drop_replication_slot($1)", "pgx_test") + if err != nil { + t.Fatalf("Failed to drop replication slot: %v", err) + } + }