Remove useless reports, avoid DB-Races

This commit is contained in:
2026-05-16 13:25:10 -03:00
parent b54375dbb3
commit 026efec79b
9 changed files with 88 additions and 74 deletions
+2 -2
View File
@@ -165,7 +165,7 @@ def test_repeated_failure_days_threshold_creates_alert():
assert any(alert.type == "repeated_dmarc_failure" for alert, _, _ in alerts)
def test_missing_reporter_threshold_creates_alert():
def test_missing_reporter_gap_does_not_create_alert():
session = _session()
settings = _settings()
now = datetime(2026, 5, 16, 12, tzinfo=timezone.utc)
@@ -174,4 +174,4 @@ def test_missing_reporter_threshold_creates_alert():
alerts = analyze_report(session, settings, report)
assert any(alert.type == "missing_reporter" for alert, _, _ in alerts)
assert not any(alert.type == "missing_reporter" for alert, _, _ in alerts)
+16
View File
@@ -0,0 +1,16 @@
from app.inbox_locks import InboxRunLocks
def test_inbox_run_locks_serialize_different_inboxes():
locks = InboxRunLocks()
first = locks.acquire("first", blocking=False)
assert first is not None
try:
assert locks.acquire("second", blocking=False) is None
finally:
first.release()
second = locks.acquire("second", blocking=False)
assert second is not None
second.release()