Skip to content

Commit 5a670dc

Browse files
committed
parallelize TestContextCancelStmtQuery
1 parent 18dca94 commit 5a670dc

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
@@ -2797,10 +2797,10 @@ func TestContextCancelStmtExec(t *testing.T) {
27972797
}
27982798

27992799
func TestContextCancelStmtQuery(t *testing.T) {
2800-
runTests(t, dsn, func(dbt *DBTest) {
2801-
dbt.mustExec("CREATE TABLE test (v INTEGER)")
2800+
runTestsParallel(t, dsn, func(dbt *DBTest, tbl string) {
2801+
dbt.mustExec("CREATE TABLE " + tbl + " (v INTEGER)")
28022802
ctx, cancel := context.WithCancel(context.Background())
2803-
stmt, err := dbt.db.PrepareContext(ctx, "INSERT INTO test VALUES (SLEEP(1))")
2803+
stmt, err := dbt.db.PrepareContext(ctx, "INSERT INTO "+tbl+" VALUES (SLEEP(1))")
28042804
if err != nil {
28052805
dbt.Fatalf("unexpected error: %v", err)
28062806
}
@@ -2822,7 +2822,7 @@ func TestContextCancelStmtQuery(t *testing.T) {
28222822

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

0 commit comments

Comments
 (0)