#3544·gopass

test: isolate shared output globals in parallel leaf-store tests

Author: dantte-lpCreated Aug 20, 2026Updated Aug 20, 2026

go test -race ./... reaches a second test-isolation class after the production races addressed by #3540: many internal/store/leaf tests run in parallel while replacing package-global output writers (internal/out.Stdout/related state). Race reports show concurrent writes from move_test.go and recipients_test.go, plus concurrent writes to the same bytes.Buffer through out.Printf.

Representative reproducer:

bash
go test -race ./internal/store/leaf

Acceptance criteria:

  • parallel leaf tests must not replace shared package globals concurrently
  • prefer dependency-injected/per-test writers; as a smaller first step, serialize only tests that mutate globals
  • go test -race ./internal/store/leaf passes repeatedly with -count=10 -shuffle=on
  • do not silence the race detector

This is distinct from the queued context capture race in Store.Set, whose targeted TestConvert reproducer is fixed in #3540.