Commit Graph
1 Commits
Author SHA1 Message Date
Omar Sobh 66f730ad16 test(db): a regression net for the three-minute bug, with its negative control
The #54 fix had no test that could see it. Its defining property is that it only
appears past 180 seconds, and `verify-mission-delivery.sh microvm` runs a
90-second mission — so the end-to-end harness written to catch silent failure was
structurally blind to this one. A unit test asserting the allowlist's membership
helps, but would not notice a NEW sweeper added without the filter.

`crates/cm-db/tests/self_driven_runs.rs` tests the real SQL against a migrated
database, in milliseconds instead of eight minutes:

  - a `microvm` and a `session` run, 30 minutes idle and still `running`, must be
    left alone by `requeue_stale` — that is the bug, in one assertion
  - a `team` run in the SAME state must still be requeued, so the fix is "sweep the
    right rows" and not "stop sweeping"
  - the worker must not CLAIM a queued self-driven row, which is what turned a
    healthy run into "missing or invalid graph"
  - the allowlist names only worker-driven tiers

NEGATIVE CONTROL, run rather than assumed: with the tier filter removed from
`requeue_stale`, `requeue_stale_leaves_self_driven_runs_alone` FAILS; restored, it
passes. A guard that cannot detect the bug it was written for is decoration, and
this project has shipped one of those before.

489 tests pass, clippy clean.
2026-08-06 09:52:58 -07:00