Run the tests under the race detector with make test-race (closes #18)
check / check (push) Failing after 2s

script/test-race runs go test -race in a digest-pinned Debian golang
image that has gcc, since the detector needs cgo and the build keeps it
off. The checkout is mounted read-only and the container is removed
afterwards. The tests run as the calling user, or as nobody when that is
root, so the tests that make a file unreadable still see the read fail.
It is not part of make check. The detector found no races.

Model: opus-5-5
This commit is contained in:
2026-10-04 17:31:36 +00:00
parent bebfac1dcb
commit e4e297aa60
5 changed files with 72 additions and 12 deletions
+8 -7
View File
@@ -7,8 +7,8 @@
# installed: golangci-lint (script/lint) and prettier (script/fmt,
# script/fmt-check) run via docker only, pinned by hash, so their only
# prerequisite is a working docker — which is warned about, not
# installed, because everything except linting and formatting works
# without it.
# installed, because everything except linting, formatting and
# make test-race works without it.
set -eu
ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
@@ -75,13 +75,14 @@ main() {
# Linting and Markdown formatting run via docker only, so docker is
# their prerequisite rather than something bootstrap installs. Warn,
# do not fail: everything except `make lint`, `make fmt` and
# `make fmt-check` — and, through them, `make check`, `make docker`
# and the pre-commit hook — works without it.
# do not fail: everything except `make lint`, `make fmt`,
# `make fmt-check` and `make test-race` — and, through them,
# `make check`, `make docker` and the pre-commit hook — works
# without it.
if missing docker; then
echo "bootstrap: WARNING: docker not found; make lint, make fmt," >&2
echo "bootstrap: make fmt-check, make check and make docker" >&2
echo "bootstrap: require it." >&2
echo "bootstrap: make fmt-check, make check, make docker and" >&2
echo "bootstrap: make test-race require it." >&2
fi
go mod download