make test: adopt the mandated timeout/race/cover + conditional verbose rerun pattern #2
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
REPO_POLICIES.mdmandates a specific shape for thetest:target. rgoue'scurrent target is a bare invocation:
This diverges from policy in four ways: no
-timeout 30s, no-race, no-cover, and no conditional verbose rerun on failure.This is a genuine policy divergence, not a consequence of this repo's
scaffold exemption. The exemption covers the Dockerfile, CI config, and
REPO_POLICIES.mditself; it does not cover the content of the make targetsthat do exist.
Policy text
REPO_POLICIES.md:>
make testmust complete in under 20 seconds. Add a 30-second timeout in> the Makefile.
>
make testshould use the conditional verbose rerun pattern. Run tests> without
-v(verbose) first. If tests fail, automatically rerun with-v> to show full output. This keeps CI logs and
docker buildoutput clean on> success while providing full diagnostic detail on failure.
The policy gives the Go form verbatim:
> The
exit 1ensures the target always fails after a rerun — the first run> already proved the tests are broken, so the build must not pass even if a
> flaky test happens to succeed on the second attempt.
Definition of done
test:target implements the policy pattern above, keepingthis repo's existing
$(GO_PKGS)variable rather than hardcoding./....make testpasses and completes in under 20 seconds wall clock.make checkis fully green (fmt-check,lint,test).-raceis genuinely enabled and the suite passes under it. If the racedetector surfaces a real data race, that is a finding to report, not to
paper over — stop and report rather than dropping the flag.
TODO.mdupdated in the same commit (rotate the step per the repo'sdocumented workflow).
(closes #N).Implementation requirements
maketargets /script/entrypoints only. Do not invokego testdirectly to verify; verify through
make testandmake check..golangci.yml— it is byte-identical to the orgcanonical config and may only change with sneak's explicit permission.
make testwall-clock time in the PR body.Out of scope
script/entrypoints (this repo isexplicitly exempt — see
TODO.mdFuture Steps note 3).Implementation plan
Branching from
main(d6cd418) into a temporary worktree on branchmake-test-policy-pattern.1. Makefile
test:target — replace the bare invocation with the policypattern, keeping this repo's
$(GO_PKGS)rather than hardcoding./...:Notes on the shape: the recipe is
@-prefixed and the rerun branch ends inexit 1so a flaky second-run pass still fails the target, exactly as thepolicy text specifies. No other target changes;
check: fmt-check lint testalready picks this up.
2. Verification —
make testandmake checkonly; no directgo test/go vet/golangci-lintinvocations, per the issue'simplementation requirements. I will time
make testwith the new flags andreport the wall-clock number against the 20s policy budget.
3. Race detector risk — this is the substantive part of the change, not
the Makefile edit. The suite drives a tcell terminal layer and has
os.Exit-path tests, so-raceis the first time concurrent access in thedaemon/terminal code gets checked. If the detector reports a genuine data
race I will stop, post the full detector output here and to the parent, and
not drop
-race, add a//nolint, or otherwise paper over it. Likewise ifthe suite exceeds 20s I will report the measurement rather than quietly
removing a flag.
4.
TODO.md— updated in the same commit as the Makefile change. Per theprecedent set by the
golangci-v2.12.2work (63d1e79), out-of-band policywork adds an entry at the top of Completed Steps and leaves Next Step alone:
the current Next Step is "broaden unit test coverage", which is not this work,
so rotating it would falsely mark it done and would promote a deferred
Future Step into Next. Markdown formatted with
make fmt.Out of scope, explicitly untouched:
.golangci.yml(byte-identical tocanonical, needs sneak's permission), Dockerfile / CI /
script/entrypoints(repo is exempt per TODO.md Future Steps note 3), the golangci-lint version
pin, and any game behavior — this is a build-tooling commit only.
Commit title will end with
(closes #2); PR againstmain, labeledneeds-review, assigned toclawbot.