Repository navigation
Isolate detached curation work in the API test - #8
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebase of #2 (originally by @LAIM69420) onto current
main. The curation-kind refactor landed onmainafter this PR was opened (bug_sweepwas collapsed intooverseer, see73a0eda); the rebase carried the fix forward onto theoverseerversion of the test via context matching, no manual edits needed.What changed
Root cause
test_curate_endpoint_requires_auth_and_starts_in_backgroundlaunched the real curation pass withasyncio.create_taskand returned without joining it. The following test's fixture could then clear the shared SQLite database while that detached task still held or used another session, intermittently producingsqlite3.OperationalError: database is lockedat the next test's setup.Note:
mainseparately picked up WAL mode + abusy_timeoutat the engine level (ca91d67) since this PR was opened, which addresses the same symptom from a different angle. That's a good belt-and-suspenders complement, not a replacement — it doesn't make this test's background task deterministic, it just makes lock contention less likely to surface as a hard failure while the race still exists.Validation
pytest tests/integration/test_api.py -q— 11 passedpytest -qfour consecutive times — 509 passed each runruff check tests/integration/test_api.py— cleanCloses #2.