From 5a56df2a061471d4b44292a87b7d4f77219ee64d Mon Sep 17 00:00:00 2001 From: euxaristia Date: Fri, 21 Aug 2026 23:49:00 -0400 Subject: [PATCH 1/2] ci: run the race detector on pull requests The Makefile declares `go test ./... -race -count=1` as the project's test command, but no workflow invokes that target. ci.yml and pr-auto-review.yml both run plain `go test ./...`, and `-race` appears nowhere under .github/workflows, so the detector has never run on a pull request. The concurrent paths where a race is easiest to introduce and hardest to see in review, the turn loop, streaming provider I/O, the session store, cron, swarm mailboxes, and the cross-process lock paths in the credential and OAuth stores, are all unchecked. Add a dedicated job rather than putting -race on the existing matrix step. A race run is typically several times a plain one, and the matrix Test step is followed by build and smoke, so folding it in would serialize behind those and make that job the new long pole. On its own it runs alongside the Windows job, which is the current long pole at 9m29s, and a failure reads as a race rather than as a smoke failure. Run `make test` instead of repeating its flags, so the project's declared test command and what CI executes cannot drift apart again. Refs #939 --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b63b364fd..6f37bae27 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,6 +84,34 @@ jobs: - name: Smoke binary run: go run ./cmd/zero-release smoke + race: + name: Race Detector + runs-on: ubuntu-latest + # A race the detector newly reports can present as a deadlock rather than a + # failure, and the default job timeout is six hours. This job is expected to + # be the longest in the workflow, so the ceiling is generous but finite. + timeout-minutes: 30 + + steps: + - name: Checkout + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + with: + persist-credentials: false + + - name: Setup Go + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff + with: + go-version-file: go.mod + cache: true + + # Invoke the Makefile target rather than repeating its flags. `make test` + # is already `go test ./... -race -count=1`, so running it here is what + # stops the project's declared test command and what CI actually runs + # from drifting apart again. The race detector needs cgo, which the + # hosted ubuntu runner supplies without an extra setup step. + - name: Test with the race detector + run: make test + performance: name: Performance Smoke runs-on: ubuntu-latest From c70a1e71e24ab700745e72b18d720649cdef7371 Mon Sep 17 00:00:00 2001 From: euxaristia Date: Sat, 22 Aug 2026 16:54:57 -0400 Subject: [PATCH 2/2] ci: add permissions to race detector job --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f37bae27..45c6bd735 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,6 +87,8 @@ jobs: race: name: Race Detector runs-on: ubuntu-latest + permissions: + contents: read # A race the detector newly reports can present as a deadlock rather than a # failure, and the default job timeout is six hours. This job is expected to # be the longest in the workflow, so the ceiling is generous but finite.