Skip to content

Commit 1334c74

Browse files
committed
tests: add a longer sleep to the query interrupt tests, due to free threading starting it earlier
1 parent 458ffc3 commit 1334c74

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

tests/fast/api/test_connection_interrupt.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ def test_connection_interrupt(self):
1616

1717
def interrupt():
1818
# Wait for query to start running before interrupting
19-
time.sleep(0.1)
19+
time.sleep(1)
2020
conn.interrupt()
2121

2222
thread = threading.Thread(target=interrupt)
2323
thread.start()
2424
with pytest.raises(duckdb.InterruptException):
25-
conn.execute("select count(*) from range(100000000000)").fetchall()
25+
conn.execute('select * from range(100000) t1,range(100000) t2').fetchall()
26+
2627
thread.join()
2728

2829
def test_interrupt_closed_connection(self):

tests/fast/api/test_query_interrupt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
def send_keyboard_interrupt():
1111
# Wait a little, so we're sure the 'execute' has started
12-
time.sleep(0.1)
12+
time.sleep(1)
1313
# Send an interrupt to the main thread
1414
thread.interrupt_main()
1515

@@ -25,7 +25,7 @@ def test_query_interruption(self):
2525
# Start the thread
2626
thread.start()
2727
try:
28-
res = con.execute('select count(*) from range(100000000000)').fetchall()
28+
con.execute('select * from range(100000) t1,range(100000) t2').fetchall()
2929
except RuntimeError:
3030
# If this is not reached, we could not cancel the query before it completed
3131
# indicating that the query interruption functionality is broken

0 commit comments

Comments
 (0)