Skip to content

Commit d7650a1

Browse files
committed
parallelize TestContextBeginIsolationLevel
1 parent 7af63b5 commit d7650a1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

driver_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2892,8 +2892,8 @@ func TestContextCancelBegin(t *testing.T) {
28922892
}
28932893

28942894
func TestContextBeginIsolationLevel(t *testing.T) {
2895-
runTests(t, dsn, func(dbt *DBTest) {
2896-
dbt.mustExec("CREATE TABLE test (v INTEGER)")
2895+
runTestsParallel(t, dsn, func(dbt *DBTest, tbl string) {
2896+
dbt.mustExec("CREATE TABLE " + tbl + " (v INTEGER)")
28972897
ctx, cancel := context.WithCancel(context.Background())
28982898
defer cancel()
28992899

@@ -2911,13 +2911,13 @@ func TestContextBeginIsolationLevel(t *testing.T) {
29112911
dbt.Fatal(err)
29122912
}
29132913

2914-
_, err = tx1.ExecContext(ctx, "INSERT INTO test VALUES (1)")
2914+
_, err = tx1.ExecContext(ctx, "INSERT INTO "+tbl+" VALUES (1)")
29152915
if err != nil {
29162916
dbt.Fatal(err)
29172917
}
29182918

29192919
var v int
2920-
row := tx2.QueryRowContext(ctx, "SELECT COUNT(*) FROM test")
2920+
row := tx2.QueryRowContext(ctx, "SELECT COUNT(*) FROM "+tbl)
29212921
if err := row.Scan(&v); err != nil {
29222922
dbt.Fatal(err)
29232923
}
@@ -2931,7 +2931,7 @@ func TestContextBeginIsolationLevel(t *testing.T) {
29312931
dbt.Fatal(err)
29322932
}
29332933

2934-
row = tx2.QueryRowContext(ctx, "SELECT COUNT(*) FROM test")
2934+
row = tx2.QueryRowContext(ctx, "SELECT COUNT(*) FROM "+tbl)
29352935
if err := row.Scan(&v); err != nil {
29362936
dbt.Fatal(err)
29372937
}

0 commit comments

Comments
 (0)