Skip to content

Commit 4c4f124

Browse files
committed
Restore out-of-memory as valid outcome in timeout test
With a 1ms checkout timeout, disconnect can race with an in-progress SQLite allocation and return SQLITE_NOMEM before the interrupt lands. This is an inherent race at that timeout granularity, not a regression.
1 parent c235c96 commit 4c4f124

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

test/exqlite/integration_test.exs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,18 @@ 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.
246248
case DBConnection.execute(conn, query, [], timeout: 1) do
247249
{:ok, _, _} ->
248250
:ok
249251

250252
{:error, %Exqlite.Error{message: "interrupted"}} ->
251253
:ok
252254

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

0 commit comments

Comments
 (0)