Skip to content

[Repo Assist] build: add test-race Makefile target for race condition detection#3164

Merged
lpcox merged 2 commits intomainfrom
repo-assist/eng-test-race-2026-04-04-c10b15eac5a4f34e
Apr 4, 2026
Merged

[Repo Assist] build: add test-race Makefile target for race condition detection#3164
lpcox merged 2 commits intomainfrom
repo-assist/eng-test-race-2026-04-04-c10b15eac5a4f34e

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Apr 4, 2026

🤖 This pull request was created by Repo Assist, an automated AI assistant.

Summary

Adds a test-race Makefile target that runs the unit test suite under Go's built-in race detector. The MCP Gateway is a highly concurrent server that manages multiple simultaneous MCP sessions, backend launchers, and HTTP connections — race detection is an important engineering safeguard.

Changes

  • Makefile — new test-race target added after test-integration
    • Runs go test -race -timeout=5m ./internal/...
    • 5-minute timeout accommodates the ~2–5× overhead typical of race detection
    • Added to the .PHONY list and help output

Usage

make test-race

Why this matters

Go's race detector instruments memory accesses at compile time and catches concurrent reads/writes to shared memory without synchronisation. False negatives are possible (races are not always triggered), but false positives are extremely rare. Running this locally before PRs involving concurrency-sensitive code (launchers, proxy handlers, session management) is valuable.

Test Status

⚠️ Infrastructure limitation: Go 1.24.13 is available locally but go.mod requires Go 1.25.0, and the toolchain download is blocked by the network firewall. The Makefile syntax has been verified by review. Tests will run normally in GitHub Actions CI where Go 1.25.0 is available.

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@851905c06e905bf362a9f6cc54f912e3df747d55

The MCP Gateway is a highly concurrent server handling multiple simultaneous
MCP connections. Running tests with the Go race detector surfaces data races
that regular unit tests may miss.

Add a test-race target that:
- Runs all unit tests under Go's -race detector
- Uses a 5-minute timeout to accommodate the overhead of race detection
- Is fast to run locally without requiring a build step

Usage:
  make test-race

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lpcox lpcox marked this pull request as ready for review April 4, 2026 18:22
Copilot AI review requested due to automatic review settings April 4, 2026 18:22
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a test-race Makefile target to run the Go unit test suite under the race detector, providing an easy local/CI-friendly way to catch data races in this concurrent MCP Gateway codebase.

Changes:

  • Added test-race target running go test -race -timeout=5m ./internal/...
  • Registered test-race in .PHONY
  • Documented test-race in the help output
Show a summary per file
File Description
Makefile Introduces a test-race target and exposes it via .PHONY and help for convenient race detection runs.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@lpcox lpcox merged commit bfd28df into main Apr 4, 2026
5 checks passed
@lpcox lpcox deleted the repo-assist/eng-test-race-2026-04-04-c10b15eac5a4f34e branch April 4, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants