ci: reduce Python test overhead and Windows latency (#6357)
* test: merge overlapping semantic contract coverage Consolidate the six confirmed NAN-310 overlap groups while preserving replay, usage, generation kwargs, archive metadata, inspect fields, and subagent crash/redelivery assertions. * test: lighten history seeds and layer runner progress rules * ci: defer test storage setup and record phase timings Close each listener-owned binary bridge before waiting for its TCP server; retain active upload and undecided-connection regressions. Avoid consuming readiness twice and run the repository import scan once in its static gate. NAN-310. * test: scope filesystem mocks and observe consumed socket prefixes * test: publish subprocess readiness files atomically * ci: isolate external tool discovery and use three Windows workers
This commit is contained in:
1 parent
743c51e81f
commit
f284749d2f
28 files changed
+518
-448
No files matched your search
@@ -2,19 +2,35 @@
|
||||
|
||||
import pytest
|
||||
|
||||
from nanobot.session.manager import SessionManager
|
||||
from nanobot.session.manager import Session, SessionManager
|
||||
from nanobot.session.sqlite_store import SessionConflictError
|
||||
|
||||
|
||||
async def test_committed_view_cache_is_bounded(tmp_path):
|
||||
state = SessionManager(tmp_path).state
|
||||
for i in range(140):
|
||||
await state.get(str(i))
|
||||
await state.update_metadata(str(i), {"title": str(i)})
|
||||
assert len(state._snapshots) <= 128
|
||||
assert state.peek("0") is None
|
||||
assert (await state.get("0")).metadata["title"] == "0"
|
||||
await state.aclose()
|
||||
manager = SessionManager(tmp_path)
|
||||
# Persist the input before binding the async owner; exercise real cache reads below.
|
||||
with manager._store.transaction():
|
||||
for i in range(140):
|
||||
manager.save(Session(key=str(i), metadata={"title": str(i)}))
|
||||
state = manager.state
|
||||
try:
|
||||
for i in range(140):
|
||||
await state.get(str(i))
|
||||
assert len(state._snapshots) <= 128
|
||||
if i == 127:
|
||||
assert len(state._snapshots) == 128
|
||||
assert state.peek("0") is not None
|
||||
elif i == 128:
|
||||
assert len(state._snapshots) == 128
|
||||
assert state.peek("0") is None
|
||||
await state.update_metadata("139", {"title": "updated"})
|
||||
assert state.peek("139").metadata["title"] == "updated"
|
||||
assert len(state._snapshots) == 128
|
||||
assert state.peek("0") is None
|
||||
assert (await state.get("0")).metadata["title"] == "0"
|
||||
assert len(state._snapshots) == 128
|
||||
finally:
|
||||
await state.aclose()
|
||||
|
||||
|
||||
async def test_cached_views_are_detached(tmp_path):
|
||||
|
||||
Reference in new issue
Block a user