(t *testing.T)
| 314 | } |
| 315 | |
| 316 | func TestExecContextWithoutCancelation(t *testing.T) { |
| 317 | t.Parallel() |
| 318 | |
| 319 | ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second) |
| 320 | defer cancel() |
| 321 | |
| 322 | pgxtest.RunWithQueryExecModes(ctx, t, defaultConnTestRunner, nil, func(ctx context.Context, t testing.TB, conn *pgx.Conn) { |
| 323 | ctx, cancelFunc := context.WithCancel(ctx) |
| 324 | defer cancelFunc() |
| 325 | |
| 326 | commandTag, err := conn.Exec(ctx, "create temporary table foo(id integer primary key);") |
| 327 | if err != nil { |
| 328 | t.Fatal(err) |
| 329 | } |
| 330 | if commandTag.String() != "CREATE TABLE" { |
| 331 | t.Fatalf("Unexpected results from Exec: %v", commandTag) |
| 332 | } |
| 333 | assert.False(t, pgconn.SafeToRetry(err)) |
| 334 | }) |
| 335 | } |
| 336 | |
| 337 | func TestExecContextFailureWithoutCancelation(t *testing.T) { |
| 338 | t.Parallel() |
nothing calls this directly
no test coverage detected