From 1ee27da3326276bd09c14f2e4386b5eb5192ff0d Mon Sep 17 00:00:00 2001 From: curo1305 Date: Sun, 31 May 2026 15:07:18 +0200 Subject: [PATCH] test(phase-03): remove stale xfail markers from quota tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- backend/tests/test_quota.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/backend/tests/test_quota.py b/backend/tests/test_quota.py index 810594c..85597d7 100644 --- a/backend/tests/test_quota.py +++ b/backend/tests/test_quota.py @@ -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 ):