bug(serve): go test runs write into the user's real serve.log — lifecycle log path isn't test-scoped #95

Closed
opened 2026-07-15 15:15:12 +00:00 by hexajon · 0 comments
hexajon commented 2026-07-15 15:15:12 +00:00 (Migrated from codeberg.org)

Observed 2026-07-15: ~/.cache/madtea/serve.log contains entries from test-run servers (tool error ... ambiguous forge: found alpha.invalid, beta.invalid fixtures, several starts/stops with test ppids). The ADR 0022 hermetic guard covers credential resolution and git mutation but the lifecycle logger's path (newLifecycleLogger → /madtea/serve.log) is not test-scoped, so go test sessions pollute — and, being bounded/rotating, can CYCLE OUT — the real operator's serve log. That cost real diagnostics today: the log was needed to recover a swallowed finish error (#93) and the relevant entries were already displaced by test noise.

Fix: under testing.Testing() route the lifecycle log to the test temp dir (or discard), mirroring the ADR 0022 pattern; the crash-output path should follow. Acceptance: after a full go test ./..., the user-level serve.log has no new entries.

Observed 2026-07-15: ~/.cache/madtea/serve.log contains entries from test-run servers (`tool error ... ambiguous forge: found alpha.invalid, beta.invalid` fixtures, several starts/stops with test ppids). The ADR 0022 hermetic guard covers credential resolution and git mutation but the lifecycle logger's path (newLifecycleLogger → <cache>/madtea/serve.log) is not test-scoped, so `go test` sessions pollute — and, being bounded/rotating, can CYCLE OUT — the real operator's serve log. That cost real diagnostics today: the log was needed to recover a swallowed finish error (#93) and the relevant entries were already displaced by test noise. Fix: under `testing.Testing()` route the lifecycle log to the test temp dir (or discard), mirroring the ADR 0022 pattern; the crash-output path should follow. Acceptance: after a full `go test ./...`, the user-level serve.log has no new entries.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea#95
No description provided.