Skip to content

Soak test: guard long-run daemon health (memory, latency drift, retention) #101

Description

@hsliuustc0106

The always-on stage made long-run behavior real: the dogfood daemon now runs for days. Nothing currently guards slow failure modes — steady-state memory growth, per-tick latency drift as history accumulates, retention efficacy over thousands of ticks. The suite verifies correctness per-tick; nothing verifies the daemon stays healthy over a run.

Proposal

One named offline soak test (tests/test_soak.py): a compressed daemon lifetime via the fake clock — RunnerDaemon.tick() over 4,000 ticks (~13 simulated days at 300s cadence) against real SQLite, one watch with the full kit (--digest 24h --stale 2d --flaky, no required checks so it never completes), with a check-conclusion flip every 500 ticks and a new head SHA every 1,500 ticks so all three watch kinds and the statemachine transitions fire repeatedly.

Acceptance (each row asserted by the test; thresholds generous tripwires, not benchmarks)

  • Memory bounded: with tracemalloc started after warmup, peak and end-current traced memory stay within fixed budgets (e.g., end-current growth < 1 MB, peak < 10 MB)
  • No latency drift: mean wall-time of the last 200 ticks ≤ 3× the mean of the first 200 (+ small constant) — catches per-tick work that grows with history
  • Retention effective after the full run: check-observed rows for the task ≤ OBSERVATION_RETENTION (20)
  • DB size bounded: the SQLite file stays < 10 MB for the whole simulated fortnight
  • Functional sanity across the run: digests ≈ simulated_days, ≥1 stale, ≥1 flaky fired; the task ends ACTIVE and schedulable
  • Suite cost: the soak adds ≤ ~6s to the full run (keep it compressed via the fake clock, not real sleeps)
  • Full suite + offline demo stay green

If any budget trips, the finding is investigated before widening the budget — a budget change is a decision, not a fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions