Skip to content

Commit 1dc222a

Browse files
mjcCopilot
andcommitted
Tighten timeout cancellation regression
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4a883c2 commit 1dc222a

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

test/exqlite/integration_test.exs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -243,18 +243,15 @@ defmodule Exqlite.IntegrationTest do
243243
# With the cancellable busy handler (issue #192), disconnect now properly
244244
# interrupts running queries via the progress handler. So a query that
245245
# exceeds the checkout timeout may be interrupted rather than completing.
246-
# With a 1ms timeout the disconnect can race mid-allocation, so SQLite may
247-
# also return SQLITE_NOMEM before the interrupt lands — that's expected here.
248-
case DBConnection.execute(conn, query, [], timeout: 1) do
246+
# Use a small but non-trivial timeout so the disconnect lands during query
247+
# execution without racing SQLite's initial row allocation path.
248+
case DBConnection.execute(conn, query, [], timeout: 10) do
249249
{:ok, _, _} ->
250250
:ok
251251

252252
{:error, %Exqlite.Error{message: "interrupted"}} ->
253253
:ok
254254

255-
{:error, %Exqlite.Error{message: "out of memory"}} ->
256-
:ok
257-
258255
{:error, %Exqlite.Error{message: msg}} ->
259256
flunk("Unexpected error while executing query: #{msg}")
260257
end

0 commit comments

Comments
 (0)