Preserve phase timings across resume runs

This commit is contained in:
yangyl
2026-06-18 03:29:06 +08:00
parent 2ccf7d5b1c
commit 726962b25b
2 changed files with 44 additions and 1 deletions

View File

@@ -377,6 +377,22 @@ class CliTests(unittest.TestCase):
json.dumps(existing_record, sort_keys=True) + "\n",
encoding="utf-8",
)
(output_dir / "phase_timings.json").write_text(
json.dumps(
{
"schema_version": "phase-timings-v1",
"started_at": "2026-06-17T00:00:00+00:00",
"updated_at": "2026-06-17T00:00:00+00:00",
"phases": {
"source_acquisition_seconds": 7.0,
"inference_seconds": 11.0,
},
},
sort_keys=True,
)
+ "\n",
encoding="utf-8",
)
config_path = root / "local_batch.yaml"
config_path.write_text(
"\n".join(
@@ -405,6 +421,14 @@ class CliTests(unittest.TestCase):
for line in manifest_path.read_text(encoding="utf-8").splitlines()
]
self.assertEqual(records, [existing_record])
phase_timings = json.loads(
(output_dir / "phase_timings.json").read_text(encoding="utf-8")
)
self.assertGreaterEqual(
phase_timings["phases"]["source_acquisition_seconds"],
7.0,
)
self.assertEqual(phase_timings["phases"]["inference_seconds"], 11.0)
def test_until_clips_writes_video_frame_and_clip_manifests_without_vlm(self):
with tempfile.TemporaryDirectory() as tmp: