Skip to content

Tests/always close statements#23

Merged
mringler merged 5 commits intomainfrom
tests/always_close_statements
Mar 15, 2025
Merged

Tests/always close statements#23
mringler merged 5 commits intomainfrom
tests/always_close_statements

Conversation

@mringler
Copy link
Copy Markdown
Collaborator

@mringler mringler commented Mar 15, 2025

Tests with sqlite kept failing with

General error: 5 database is locked

Apparently, sqlite doesn't like it when data fetchers remain open, which happens

  • in Formatters when they throw an error
  • in some tests

Now Formatters close their fetchers on exception and tests either close their statements or they are disabled on sqlite.

I wonder why this appeared all of a sudden. Usually I don't run Sqlite tests locally, never saw it on Github until #18 (which is completely unrelated). Turns out same error happened when I tried locally, but with all branches.

Error does occur in the file after the one that broke sqlite. Apparently the open statement keeps a lock on the db ile, which does not matter as long the connection remains open, but when it is reset during change of test class, the new connection fails at the second (I think) commit. This was a mfer to figure out.

@mringler mringler force-pushed the tests/always_close_statements branch from 0e085e1 to c9c37d3 Compare March 15, 2025 16:14
@mringler mringler merged commit c67ac1d into main Mar 15, 2025
34 checks passed
@mringler mringler deleted the tests/always_close_statements branch October 30, 2025 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant