Files
mrleo1nid c8d83b3fe7 feat: add mod editing, revision merges and secure game storage
Add immutable revisions, PGVN editor, asset replacement, merge and rebase workflows, authenticated media delivery and reachability GC. Harden the script interpreter, pin unrpyc and remove tracked build metadata. Include current compatibility checks, Naninovel import and regression tests.
2026-10-25 04:42:48 +03:00

28 lines
815 B
Python

import asyncio
import os
import pytest
from app.config import get_settings
from app.maintenance import acquire, release
@pytest.mark.skipif(os.name == "nt", reason="Production shared flock semantics are POSIX")
def test_gc_excludes_active_writers(tmp_path, monkeypatch):
monkeypatch.setenv("DATA_DIR", str(tmp_path))
get_settings.cache_clear()
async def check():
writer = acquire()
gc = asyncio.create_task(asyncio.to_thread(acquire, True))
try:
with pytest.raises(asyncio.TimeoutError):
await asyncio.wait_for(asyncio.shield(gc), .1)
finally:
release(writer)
maintenance = await asyncio.wait_for(gc, 3)
release(maintenance)
try:
asyncio.run(check())
finally:
get_settings.cache_clear()