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.
28 lines
815 B
Python
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()
|