Skip to content

QueryTranslationVariantTests: a decimal OrderBy case failed once with 'database is locked' on a private in-memory SQLite connection #147

Closed as not planned

Description

@CaffeinatedCoder

Problem

QueryTranslationVariantTests.A_query_over_a_value_object_answers_as_the_same_query_over_the_wrapped_type(kind: "decimal", conversion: TypeKit, site: Nullable, accessor: Itself, op: OrderBy) failed once on the Linux test leg, and passed on Windows in the same run and on every earlier run:

refused where the same query over the wrapped type answers [<null>, 1.5, 10.0]: Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 5: 'database is locked

Run: https://github.com/CaffeinatedCoder/CodoMetis.TypeKit/actions/runs/40889709782 (PR #141, head 5a22140, whose diff touches no EF Core code or test).

Each case seeds its own Data Source=:memory: connection (QueryTranslationVariantTests.Seeded), so no other test shares the database. A lock there points to two commands on one connection at once, such as a reader the case left open while the next command ran, rather than to contention between tests. The variant oracle then reads the lock as the value object's query being refused, so a flake reports as a translation difference.

Change

Find which command holds the lock (likely a reader from the wrapped-type side not disposed before the value-object side runs, or the seeding context still open), dispose it, and make an infrastructure exception such as SqliteException with SQLITE_BUSY/LOCKED fail the case as an error of the harness rather than as a refusal.

Done when

The case runs reliably, and an SqliteException from the harness never reads as a refusal in the oracle's message.

Activity

  1. added
    testsAdds or changes tests only (tests, probes, harnesses); no library code
    package/efcoreAffects CodoMetis.TypeKit.EntityFrameworkCore
    on Oct 29, 2026
  2. CaffeinatedCoder commented on Oct 29, 2026

    @CaffeinatedCoder
    OwnerAuthor

    Duplicate of #148, which has the cause: parallel cases share one cached SqliteConnection.

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

    duplicateThis issue or pull request already existspackage/efcoreAffects CodoMetis.TypeKit.EntityFrameworkCoretestsAdds or changes tests only (tests, probes, harnesses); no library code

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions