next is red: TestCheckQuietShowsFailedFiles catches log lines from tests running outside runMu #210

Open
opened 2026-10-13 19:35:00 +02:00 by clawbot · 1 comment
Collaborator

next is red at 2449688: TestCheckQuietShowsFailedFiles in internal/cli/entry_test.go (added by #200) fails with Should be empty, but was • loaded manifest with 2 files, in the first run and again in the -v rerun of the Docker test stage.

The test runs check -q on a passing tree and expects no output. runCLIWithLevel holds runMu for the run, and CLIApp.run in internal/cli/mfer.go points the process-global logger at the run's buffers (log.SetOutput) before setVerbosity applies -q. Tests that call the library outside runMu log through that same global logger (manifest loads, scans, checks), so a line one of them logs at info level in that window lands in this run's stderr. The new test is the first to assert that a -q run prints nothing at all, so it is the first to catch the leak; #199 added CLI tests that load manifests in parallel, which may have widened it.

Severity: critical. next is red.

Correct: no test in internal/cli logs through the process-global logger while another test's run owns it. Use the pattern already there: a test that calls code which logs, outside runCLI, holds runMu through runLocked (internal/cli/errmsg_test.go). The product code does not change, and TestCheckQuietShowsFailedFiles keeps its assertion that a passing check -q prints nothing.

Definition of done

  • Every test in internal/cli that reaches the logger outside runCLI does so under runMu.
  • make test passes several times in a row on a loaded host.
  • make check passes.

Model: opus-5-5

`next` is red at 2449688: `TestCheckQuietShowsFailedFiles` in `internal/cli/entry_test.go` (added by https://git.eeqj.de/sneak/mfer/pulls/200) fails with `Should be empty, but was • loaded manifest with 2 files`, in the first run and again in the `-v` rerun of the Docker test stage. The test runs `check -q` on a passing tree and expects no output. `runCLIWithLevel` holds `runMu` for the run, and `CLIApp.run` in `internal/cli/mfer.go` points the process-global logger at the run's buffers (`log.SetOutput`) before `setVerbosity` applies `-q`. Tests that call the library outside `runMu` log through that same global logger (manifest loads, scans, checks), so a line one of them logs at info level in that window lands in this run's stderr. The new test is the first to assert that a `-q` run prints nothing at all, so it is the first to catch the leak; https://git.eeqj.de/sneak/mfer/pulls/199 added CLI tests that load manifests in parallel, which may have widened it. Severity: critical. `next` is red. Correct: no test in `internal/cli` logs through the process-global logger while another test's run owns it. Use the pattern already there: a test that calls code which logs, outside `runCLI`, holds `runMu` through `runLocked` (`internal/cli/errmsg_test.go`). The product code does not change, and `TestCheckQuietShowsFailedFiles` keeps its assertion that a passing `check -q` prints nothing. ## Definition of done - Every test in `internal/cli` that reaches the logger outside `runCLI` does so under `runMu`. - `make test` passes several times in a row on a loaded host. - `make check` passes. Model: opus-5-5
clawbot self-assigned this 2026-10-13 19:35:00 +02:00
Author
Collaborator

Fix in #219: every internal/cli test that loads or scans a manifest, or makes a download retry, outside runCLI now holds runMu. Tests only.

Model: opus-5-5

Fix in https://git.eeqj.de/sneak/mfer/pulls/219: every `internal/cli` test that loads or scans a manifest, or makes a download retry, outside `runCLI` now holds `runMu`. Tests only. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/mfer#210