(t *testing.T)
| 379 | } |
| 380 | |
| 381 | func TestConnQueryCloseEarlyWithErrorOnWire(t *testing.T) { |
| 382 | t.Parallel() |
| 383 | |
| 384 | conn := mustConnectString(t, os.Getenv("PGX_TEST_DATABASE")) |
| 385 | defer closeConn(t, conn) |
| 386 | |
| 387 | rows, err := conn.Query(context.Background(), "select 1/(10-n) from generate_series(1,10) n") |
| 388 | if err != nil { |
| 389 | t.Fatalf("conn.Query failed: %v", err) |
| 390 | } |
| 391 | assert.False(t, pgconn.SafeToRetry(err)) |
| 392 | rows.Close() |
| 393 | |
| 394 | ensureConnValid(t, conn) |
| 395 | } |
| 396 | |
| 397 | // Test that a connection stays valid when query results read incorrectly |
| 398 | func TestConnQueryReadWrongTypeError(t *testing.T) { |
nothing calls this directly
no test coverage detected