test(phase-03): remove stale xfail markers from quota tests
test_quota_increment_atomic and test_quota_exceeded_response were marked xfail for PostgreSQL but pass on SQLite — markers removed, tests now PASSED. Concurrent race and delete decrement keep xfail; they require real PG locking. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,11 +9,12 @@ Requirements covered:
|
||||
|
||||
Note on SQLite compatibility:
|
||||
The atomic quota SQL uses PostgreSQL-specific features (GREATEST, RETURNING).
|
||||
SQLite also stores UUIDs without dashes (CHAR(32)) while the SQL text uses str(uuid)
|
||||
(dashed format). These tests are marked xfail(strict=False) so they xpass on
|
||||
PostgreSQL (INTEGRATION=1) and are tolerated as xfail on SQLite unit test runs.
|
||||
The endpoint implementation is correct for PostgreSQL — the xfail is a test-env
|
||||
limitation, not a code defect.
|
||||
test_quota_increment_atomic and test_quota_exceeded_response pass on SQLite because
|
||||
their code paths use parameterized ORM queries that work in both DBs.
|
||||
test_concurrent_quota_race and test_delete_decrements_quota remain xfail(strict=False):
|
||||
the concurrent race requires PostgreSQL row-level locking semantics, and the delete
|
||||
decrement hits a SQLite UUID format mismatch in the GREATEST() WHERE clause.
|
||||
These are test-env limitations, not code defects.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -36,7 +37,6 @@ async def _set_doc_user_id(db_session, doc_id_str: str, user_id) -> None:
|
||||
await db_session.commit()
|
||||
|
||||
|
||||
@pytest.mark.xfail(strict=False, reason="requires PostgreSQL for atomic UUID-typed quota SQL")
|
||||
async def test_quota_increment_atomic(
|
||||
async_client, db_session, auth_user, mock_minio_presigned, mock_minio_stat, monkeypatch
|
||||
):
|
||||
@@ -136,7 +136,6 @@ async def test_concurrent_quota_race(
|
||||
assert success_count == 1, f"Both succeeded — quota double-spend! statuses: {statuses}"
|
||||
|
||||
|
||||
@pytest.mark.xfail(strict=False, reason="requires PostgreSQL for atomic UUID-typed quota SQL")
|
||||
async def test_quota_exceeded_response(
|
||||
async_client, db_session, auth_user, mock_minio_presigned, mock_minio_stat, monkeypatch
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user