Skip to content

Commit 7af63b5

Browse files
committed
parallelize TestContextCancelBegin
1 parent 5a670dc commit 7af63b5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

driver_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2836,8 +2836,8 @@ func TestContextCancelBegin(t *testing.T) {
28362836
t.Skip(`FIXME: it sometime fails with "expected driver.ErrBadConn, got sql: connection is already closed" on windows and macOS`)
28372837
}
28382838

2839-
runTests(t, dsn, func(dbt *DBTest) {
2840-
dbt.mustExec("CREATE TABLE test (v INTEGER)")
2839+
runTestsParallel(t, dsn, func(dbt *DBTest, tbl string) {
2840+
dbt.mustExec("CREATE TABLE " + tbl + " (v INTEGER)")
28412841
ctx, cancel := context.WithCancel(context.Background())
28422842
conn, err := dbt.db.Conn(ctx)
28432843
if err != nil {
@@ -2854,7 +2854,7 @@ func TestContextCancelBegin(t *testing.T) {
28542854

28552855
// This query will be canceled.
28562856
startTime := time.Now()
2857-
if _, err := tx.ExecContext(ctx, "INSERT INTO test VALUES (SLEEP(1))"); err != context.Canceled {
2857+
if _, err := tx.ExecContext(ctx, "INSERT INTO "+tbl+" VALUES (SLEEP(1))"); err != context.Canceled {
28582858
dbt.Errorf("expected context.Canceled, got %v", err)
28592859
}
28602860
if d := time.Since(startTime); d > 500*time.Millisecond {

0 commit comments

Comments
 (0)