Skip to content

Commit 18dca94

Browse files
committed
parallelize TestContextCancelStmtExec
1 parent c9febfc commit 18dca94

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

driver_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2762,10 +2762,10 @@ func TestContextCancelPrepare(t *testing.T) {
27622762
}
27632763

27642764
func TestContextCancelStmtExec(t *testing.T) {
2765-
runTests(t, dsn, func(dbt *DBTest) {
2766-
dbt.mustExec("CREATE TABLE test (v INTEGER)")
2765+
runTestsParallel(t, dsn, func(dbt *DBTest, tbl string) {
2766+
dbt.mustExec("CREATE TABLE " + tbl + " (v INTEGER)")
27672767
ctx, cancel := context.WithCancel(context.Background())
2768-
stmt, err := dbt.db.PrepareContext(ctx, "INSERT INTO test VALUES (SLEEP(1))")
2768+
stmt, err := dbt.db.PrepareContext(ctx, "INSERT INTO "+tbl+" VALUES (SLEEP(1))")
27692769
if err != nil {
27702770
dbt.Fatalf("unexpected error: %v", err)
27712771
}
@@ -2787,7 +2787,7 @@ func TestContextCancelStmtExec(t *testing.T) {
27872787

27882788
// Check how many times the query is executed.
27892789
var v int
2790-
if err := dbt.db.QueryRow("SELECT COUNT(*) FROM test").Scan(&v); err != nil {
2790+
if err := dbt.db.QueryRow("SELECT COUNT(*) FROM " + tbl).Scan(&v); err != nil {
27912791
dbt.Fatalf("%s", err.Error())
27922792
}
27932793
if v != 1 { // TODO: need to kill the query, and v should be 0.

0 commit comments

Comments
 (0)