refactor(lab): move execution to Worker and manage replay and transfer lifecycles

This commit is contained in:
DCCONSTRUCTIONS
2026-11-10 01:09:39 +03:00
parent cd34b6ce1a
commit fe5900ff3b
101 changed files with 9305 additions and 2256 deletions
+30 -3
View File
@@ -312,9 +312,7 @@ def test_camera_playback_source_reuses_manifest_and_exposes_exact_segment_clock(
assert first == second
assert first.segment_count == 3
assert first.segment_sha256s == tuple(
segment.sha256 for segment in manifest.epochs[0].segments
)
assert first.segment_sha256s == tuple(segment.sha256 for segment in manifest.epochs[0].segments)
assert first.segment_start_times_ns == (0, 1_000_000_000, 2_000_000_000)
assert store.prepare_calls == 1
assert inspector.inspect_calls == 1
@@ -325,3 +323,32 @@ def test_camera_frame_rejects_unbounded_memory_cache_configuration(tmp_path: Pat
inspector = _Inspector(_manifest(tmp_path))
with pytest.raises(SessionIntegrityError, match="cache bounds"):
_service(tmp_path, store, inspector, max_decode_lanes=0)
def test_worker_manifest_provider_needs_no_operator_store(tmp_path, monkeypatch):
manifest = _manifest(tmp_path)
inspector = _Inspector(manifest)
calls = []
def provider(session, source):
calls.append((session, source))
return manifest
service = RecordedCameraFrameService(
None,
inspector,
ffmpeg_path=Path(sys.executable),
cache_root=tmp_path / "cache",
manifest_provider=provider,
)
monkeypatch.setattr(service, "_decode", lambda m, e, seq: _frame(e, seq))
assert (
service.extract("recorded-session", 0).source_fragment_sha256
== manifest.epochs[0].segments[0].sha256
)
assert (
service.extract("recorded-session", 1).source_fragment_sha256
== manifest.epochs[0].segments[1].sha256
)
assert calls == [("recorded-session", "sensor.camera.right")]
assert inspector.inspect_calls == 0