Skip to content

Locked-database test mocks one query; add a test that holds a real lock #129

Open

Description

@inth3shadows

Found by the code-reviewer agent on #123.

test_locked_database_on_pending_check_warns makes the unresolved_refs query alone raise database is locked, so every other query in check() succeeds. With a real lock (BEGIN EXCLUSIVE from another process, journal_mode=DELETE), the pending query warns. Then stale_by_mtime (integrity.py:29) dies with an uncaught OperationalError after about 20 s of busy timeouts, exit 1.

That fails loud, so it is not a false green. But the test pins a path that a real lock never takes.

Fix: add a test that holds a real exclusive lock and asserts what testgraph actually does: a clean BLOCKED or retry message, and no traceback. The behaviour this test ends up asserting depends on the decision in the "database is locked" export-warning issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions