Bug: issue-backend tests fail with SQLite migration UNIQUE constraint error when run in parallel
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start in crates/issue-backend/src/lib.rs, focusing on the tests that call db::connect("sqlite::memory:") and the migration setup involving MIGRATOR.run(). Run the affected SQLite and GitHub backend tests concurrently, then confirm each test has an isolated in-memory database and no _sqlx_migrations UNIQUE constraint errors.
Written by the indexing model from the issue text.
Description
Summary
The tests in crates/issue-backend/src/lib.rs that use db::connect("sqlite::memory:") fail with:
UNIQUE constraint failed: _sqlx_migrations.version
When multiple async tests run concurrently and all call db::connect("sqlite::memory:"), they share the same in-memory database pool (since the URL is the same). The second test to call MIGRATOR.run() fails because the migration records are already present.
Affected tests
All 19 of the SQLite-based and GitHub backend tests fail (15 pass, 19 fail).
Expected behavior
Each test should get its own isolated in-memory SQLite database.
Suggested fix
Use unique connection strings per test, e.g. sqlite::memory:?cache=private or use sqlx::test(migrator = "MIGRATOR") pattern like the db crate's own tests do.
Discovered in
Branch qtua-gh-147-pluggable-issue-backends-sqlite-github-shell, commit a112f23.
- Dominant language
- Rust
- Stars
- 1
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from drufball/ns2
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100