My Runs Took 19 Hours, My Measurement Counted 58,530
说明与用途
作者发现 GitHub Actions 中的自动日志清理更改了运行元数据,导致总运行时间被高估为 58,530 小时。使用实际作业时间戳后,真实运行时间为 19.2 小时。
问题
The author measured GitHub Actions run durations incorrectly, leading to an inflated total of 58,530 hours instead of the real 19.2 hours.
结果
The author discovered that the cleanup workflow unintentionally updated run timestamps, leading to a gross overestimation of total run time. By switching to job-level timestamps, the true total duration was 19.2 hours, revealing the flaw.
工作流
- 1. Pull last 1,000 runs via GitHub Actions API with created>=2026-09-25 filter.
- 2. Sum updated_at – created_at to compute naive durations.
- 3. Pull job records for each run to compute real durations from started_at and completed_at.
- 4. Compare naive vs real durations, identify discrepancy.
- 5. Investigate age-dependent error, find 3–4 day corruption window.
- 6. Examine cleanup-actions-storage.yml workflow, noting keep_days=3 and log deletion at 05:43.
- 7. Verify that log deletion updates updated_at, causing inflated durations.
- 8. Confirm that run_started_at remains unchanged, indicating only timestamp was altered.
- 9. Conclude that naive API duration is unreliable when logs are deleted.
- 10. Recommend using job timestamps for accurate duration measurement.
证据
The docs said "about 12 minutes" in five separate places, and measuring twenty-four runs gave a median of 3.3 minutes.
I pulled the last thousand runs, summed the differences, and the screen told me: 58,530 hours.
Only 801 of the 1,000 yield a real duration; the remaining 199 consist entirely of skipped jobs.
The cleanup run started at 05:41:56 and finished at 05:45:02. The new timestamps on the records that rotted that morning are spread across four separate seconds, from 05:43:05 to 05:43:08.
The record of the janitor that ran on the morning of 21 October was overwritten at 05:43:08 on 25 October – by the colleague that came four days later.
- 记录日期: 2026-10-25T13:26:28.046Z