Skip to content

ci: the race detector never runs, though make test declares it #939

Description

@euxaristia

Summary

The Makefile declares race testing as the project's test command, but no
workflow ever runs it. make test is:

test:
	go test ./... -race -count=1

CI does not invoke that target. ci.yml:79 and pr-auto-review.yml:42 both run
plain go test ./..., and -race appears nowhere else under
.github/workflows/. So the race detector has never run on any pull request.

Why it matters

Zero is heavily concurrent in the places where a race is both easy to introduce
and hard to see in review: the agent turn loop, streaming provider I/O, the
session store, cron, swarm mailboxes, and the cross-process lock paths in the
credential and OAuth stores. A data race in any of those is invisible to
go test ./..., to go vet, and to a reviewer reading a diff.

It also makes the contributor guidance unenforceable. A change can be reviewed
against a race-freedom expectation that nothing in the pipeline actually checks,
so the first time a race shows up is as a flake or a corrupted store on a user's
machine.

Cost

Test step durations on the most recent run of main (32547741559):

runner duration
ubuntu-latest 3m33s
macos-latest 3m44s
windows-latest 4m39s

The Smoke (windows-latest) job is the current long pole at 9m29s. A race run
is typically 2-5x a plain one, so where the check is placed decides whether it
changes PR wall time or not.

Notes

-race needs cgo and a C toolchain. GitHub's hosted runners have one, so no
extra setup step is required on ubuntu.

Whether the check should block, and whether it should run on more than one
platform, is worth deciding alongside the first measured run: if the suite has
a pre-existing race, that surfaces immediately and is a separate fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue-approvedReviewed and approved by the core team; community PRs may implement this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions