feat: 31 new tests, metrics LLM counters, Dockerfile caching, Makefile targets, compose limits, code fixes

This commit is contained in:
Marker689
2026-05-11 23:08:09 +03:00
parent 20bf7e6745
commit 18efcf482e
26 changed files with 840 additions and 12 deletions

View File

@@ -231,3 +231,29 @@ async def test_harvest_skips_non_package_asset(db_session):
db_session,
)
assert scan is None
# --- Lock cleanup ---
@pytest.mark.asyncio
async def test_cleanup_url_locks_removes_unlocked():
import asyncio
from guarddog_nexus.core.harvester import _url_lock, _url_locks
async with _url_lock:
_url_locks["locked"] = asyncio.Lock()
_url_locks["unlocked"] = asyncio.Lock()
await _url_locks["locked"].acquire()
for key in list(_url_locks.keys()):
if not _url_locks[key].locked():
_url_locks.pop(key, None)
assert "locked" in _url_locks
assert "unlocked" not in _url_locks
_url_locks["locked"].release()
_url_locks.clear()