Make audit-log tests hermetic (temp HOME) #302

Closed
opened 2026-06-26 20:30:55 -04:00 by didericis-claude · 0 comments
Collaborator

From quality-eval (medium priority; the item holding Testability at 4).

Tests exercising write_audit_entry / read_audit_entries / audit_log_path in tests/unit/test_supervise.py write to the real ~/.bot-bottle and take a flock. A full coverage run hangs at 0% CPU when a live bottle's supervise sidecar holds that lock (observed). Non-hermetic / non-deterministic.

Task: Pin HOME to a tempfile.TemporaryDirectory() (setUp / patch.dict) for those tests so they never touch the real home dir or block on an unrelated lock.

No PRD required (test fix).

From quality-eval (medium priority; the item holding Testability at 4). Tests exercising `write_audit_entry` / `read_audit_entries` / `audit_log_path` in `tests/unit/test_supervise.py` write to the **real** `~/.bot-bottle` and take a `flock`. A full `coverage run` hangs at 0% CPU when a live bottle's supervise sidecar holds that lock (observed). Non-hermetic / non-deterministic. **Task:** Pin `HOME` to a `tempfile.TemporaryDirectory()` (setUp / patch.dict) for those tests so they never touch the real home dir or block on an unrelated lock. No PRD required (test fix).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: didericis/bot-bottle#302