Skip to content

Commit

Permalink
Fix copy test failure in postgres HEAD
Browse files Browse the repository at this point in the history
Commit 4fe384bd858671d40d311ca68cc9b80f4c683a3e changed the way this
works on postgres side, which sometimes caused this test to fail.
  • Loading branch information
johto committed May 1, 2015
1 parent 8910d1c commit bf66dc8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions copy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,12 +387,14 @@ func TestCopyRespLoopConnectionError(t *testing.T) {
t.Fatal(err)
}

// We have to try and send something over, since postgres won't process
// SIGTERMs while it's waiting for CopyData/CopyEnd messages; see
// tcop/postgres.c.
_, err = stmt.Exec(1)
if err != nil {
t.Fatal(err)
if getServerVersion(t, db) < 90500 {
// We have to try and send something over, since postgres before
// version 9.5 won't process SIGTERMs while it's waiting for
// CopyData/CopyEnd messages; see tcop/postgres.c.
_, err = stmt.Exec(1)
if err != nil {
t.Fatal(err)
}
}
_, err = stmt.Exec()
if err == nil {
Expand Down

0 comments on commit bf66dc8

Please sign in to comment.