feat: qualify complete K1 replay on worker
This commit is contained in:
@@ -55,6 +55,48 @@ def test_camera_replay_loads_segments_lazily_and_checks_each_digest(tmp_path: Pa
|
||||
next(events)
|
||||
|
||||
|
||||
def test_camera_replay_complete_recording_mode_has_no_duration_cutoff(
|
||||
tmp_path: Path,
|
||||
) -> None:
|
||||
module = _module(
|
||||
"e28_complete_source_replay_test",
|
||||
"experiments/perception/run_e12_shadow_transport_replay.py",
|
||||
)
|
||||
epoch = tmp_path / "epoch-1"
|
||||
segments = epoch / "segments"
|
||||
segments.mkdir(parents=True)
|
||||
(epoch / "init.mp4").write_bytes(b"init")
|
||||
rows = []
|
||||
for sequence, epoch_ns in ((1, 100_000_000), (2, 2_100_000_000)):
|
||||
payload = f"frame-{sequence}".encode()
|
||||
path = segments / f"{sequence}.m4s"
|
||||
path.write_bytes(payload)
|
||||
rows.append(
|
||||
{
|
||||
"host_epoch_ns": epoch_ns,
|
||||
"host_monotonic_ns": epoch_ns,
|
||||
"length": len(payload),
|
||||
"path": f"segments/{sequence}.m4s",
|
||||
"sequence": sequence,
|
||||
"sha256": hashlib.sha256(payload).hexdigest(),
|
||||
}
|
||||
)
|
||||
(epoch / "index.jsonl").write_text(
|
||||
"".join(json.dumps(row) + "\n" for row in rows),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
bounded = list(module._camera_events(epoch, 1.0))
|
||||
complete = list(module._camera_events(epoch, None))
|
||||
|
||||
assert [event.modality for event in bounded] == ["camera-init", "camera-frame"]
|
||||
assert [event.modality for event in complete] == [
|
||||
"camera-init",
|
||||
"camera-frame",
|
||||
"camera-frame",
|
||||
]
|
||||
|
||||
|
||||
def test_e21_trend_reports_accumulating_age_and_stable_memory() -> None:
|
||||
module = _module(
|
||||
"e21_analyzer_test",
|
||||
|
||||
Reference in New Issue
Block a user