Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

I Killed My Electron App Twice to Test Crash Recovery

Описание и применение

Тестирование восстановления после аварийного завершения процесса в Electron‑приложении ProgressCut показало, что сохранённые кадры и частично закодированные MP4 можно восстановить, а проверка длительности видео выявила ошибку в работе FFmpeg.

Задача

Ensuring an Electron‑based media exporter can recover from an abrupt process termination and finish user work without data loss.

Результат

The crash‑recovery harness successfully recovered from both capture and encoding interruptions, preserving all three frames and producing a three‑second MP4 with correct codec, pixel format, and duration. A regression test caught a duration overrun bug caused by FFmpeg’s concat demuxer.

Рабочий процесс

  • 1. Launch Electron app in a separate process group.
  • 2. Persist a per‑session manifest (JSON) with output folder, raw‑frame folder, target duration, format, timestamps.
  • 3. Capture synthetic PNGs or real screenshots until a checkpoint (e.g., after third PNG).
  • 4. Send SIGKILL to the process group to simulate crash.
  • 5. Restart Electron app, which scans recovery directory for manifests.
  • 6. For each manifest, rebuild missing frames or restart FFmpeg to finish encoding.
  • 7. Use ffprobe to verify H.264 codec, yuv420p pixel format, duration within 150 ms of target, unchanged PNG bytes, and that only completed session manifests are cleared.
  • 8. Run regression test to cap encoded output at calculated duration using FFmpeg’s -t flag.
  • 9. Verify results and clean up stale manifests.

Доказательства

I used an Electron recorder as the example below. The mechanics are simple: persist something, kill the process, restart, find the leftovers, rebuild, then inspect the result.

Источник

The harness runs two scenarios: Capture interruption – after the third PNG is persisted; Encoding interruption – after the real FFmpeg process starts.

Источник

After each kill, a fresh Electron process reads local recovery manifests. The harness rebuilds every discovered session, runs ffprobe on the output and verifies…

Источник

The first recovery run failed on a stricter check than "the file exists." The story target was three seconds. ffprobe measured 3.458333 seconds.

Источник

  • Дата записи: 2026-10-05T19:41:03.464Z