(t *testing.T)
| 544 | } |
| 545 | |
| 546 | func TestConnectWithConnectionRefused(t *testing.T) { |
| 547 | t.Parallel() |
| 548 | |
| 549 | ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second) |
| 550 | defer cancel() |
| 551 | |
| 552 | // Presumably nothing is listening on 127.0.0.1:1 |
| 553 | conn, err := pgconn.Connect(ctx, "host=127.0.0.1 port=1") |
| 554 | if err == nil { |
| 555 | conn.Close(ctx) |
| 556 | t.Fatal("Expected error establishing connection to bad port") |
| 557 | } |
| 558 | } |
| 559 | |
| 560 | func TestConnectCustomDialer(t *testing.T) { |
| 561 | t.Parallel() |