Skip to content

Isolate detached curation work in the API test - #2

Closed
LAIM69420 wants to merge 1 commit into
ehippy:mainfrom
LAIM69420:agent/stabilize-sqlite-tests
Closed

LAIM69420 wants to merge 1 commit into
ehippy:mainfrom
LAIM69420:agent/stabilize-sqlite-tests

Conversation

@LAIM69420

Copy link
Copy Markdown
Contributor

What changed

  • stub the detached curation coroutine in the API routing test
  • wait until the scheduled stub has actually run before the test exits

Root cause

test_curate_endpoint_requires_auth_and_starts_in_background launched the real curation pass with asyncio.create_task and returned without joining it. The following test fixture could then clear the shared SQLite database while that detached task still held or used another session.

The six recent failing CI runs all ended at the next test setup (test_pause_and_resume_project_via_api) with sqlite3.OperationalError: database is locked.

Impact

The endpoint test still proves that curation is scheduled asynchronously, without letting unrelated database and git work escape into the next test.

Validation

  • pytest tests/integration/test_api.py -q (5 passed)
  • pytest -q three consecutive times (244 passed each)
  • ruff check tests/integration/test_api.py

Upstream Actions on this draft PR is the final Python 3.12 verification.

@ehippy

ehippy commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Superseded by #8 — rebased onto current main (carried forward through the bug_sweep→overseer curation-kind rename), verified with the full test suite + ruff, and merged. Closing this one.

@ehippy

ehippy commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Credit where due: the root-cause analysis here was spot on — @LAIM69420 correctly traced the intermittent CI database is locked failures to the detached asyncio.create_task racing the next test's DB teardown, and the fix (stub + await) was the right shape. #8 carried it forward through the bug_sweep→overseer rename that landed after this PR was opened. Thanks for tracking this down.

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.

2 participants