generated from john/python-template
claude-sonnet-5 review: Phase 1 implemented by gpt-5.3-codex
Quality Gate / gate (push) Failing after 12s
Quality Gate / gate (push) Failing after 12s
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import asyncio
|
||||
from datetime import UTC
|
||||
from datetime import datetime
|
||||
from datetime import timedelta
|
||||
@@ -153,10 +154,33 @@ class TestJobService:
|
||||
finally:
|
||||
event.remove(bind, "before_cursor_execute", capture)
|
||||
|
||||
selects = [item for item in statements if item.lstrip().upper().startswith("SELECT")]
|
||||
assert len(selects) == 1, selects
|
||||
assert "LIMIT" in selects[0].upper()
|
||||
assert "JOIN" not in selects[0].upper()
|
||||
claim_sql = [
|
||||
item
|
||||
for item in statements
|
||||
if item.lstrip().upper().startswith(("SELECT", "UPDATE"))
|
||||
]
|
||||
assert len(claim_sql) == 1, claim_sql
|
||||
assert "LIMIT" in claim_sql[0].upper()
|
||||
assert "JOIN" not in claim_sql[0].upper()
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_claim_next_queued_job_is_atomic_on_sqlite(
|
||||
self,
|
||||
job_service: JobService,
|
||||
document_service: DocumentService,
|
||||
):
|
||||
document = await document_service.create_document(Document(id=uuid4(), name="atomic-claim-doc"))
|
||||
queued_job = await job_service.create_job(Job(document_id=document.id, status=JobStatus.QUEUED))
|
||||
|
||||
async def claim_once():
|
||||
claimed = await job_service.claim_next_queued_job()
|
||||
return claimed.id if claimed is not None else None
|
||||
|
||||
first_claim, second_claim = await asyncio.gather(claim_once(), claim_once())
|
||||
|
||||
assert [first_claim, second_claim].count(queued_job.id) == 1
|
||||
assert [first_claim, second_claim].count(None) == 1
|
||||
assert await job_service.claim_next_queued_job() is None
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_create_job_persists_provider_and_model(
|
||||
|
||||
Reference in New Issue
Block a user