feat: 31 new tests, metrics LLM counters, Dockerfile caching, Makefile targets, compose limits, code fixes
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user