test(bundle): Phase 3 idempotency and retry safety — 3 new TDD tests
Proves that process_bundle_index_job is fully retry-safe:
1. test_partial_minio_failure_retry_produces_correct_state — simulates a worker crash after 2 MinIO PUTs, rolls back the session, retries from scratch. All objects land in MinIO and DB with correct state (no orphan content_cache, no pending storage_uri).
2. test_worker_full_lifecycle_pending_to_done — exercises the full worker path: claim_next_job (pending→running), process_bundle_index_job, complete_job (→done). Verifies status transitions and done_at timestamp.
3. test_failed_job_resets_to_pending_for_retry — fail_job resets status to 'pending' for attempt < max (3). Retry claim increments attempt, retry run succeeds, final status is 'done'.
All three tests pass immediately — the ON CONFLICT DO UPDATE promotion, session rollback safety, and existing worker machinery (claim/fail/complete) already satisfy all Phase 3 invariants built during Phases 1 and 2.
0 comments
muse hub commit comment sha256:bc2c5208155b1350ca6a5d3caa3a16f1eb1b8ed4b2467f0dc7fb4b833c4f5a99 --body "your comment"
No comments yet. Be the first to start the discussion.