Conversation
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>
Contributor
There was a problem hiding this comment.
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-racetarget runninggo test -race -timeout=5m ./internal/... - Registered
test-racein.PHONY - Documented
test-racein thehelpoutput
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This pull request was created by Repo Assist, an automated AI assistant.
Summary
Adds a
test-raceMakefile 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— newtest-racetarget added aftertest-integrationgo test -race -timeout=5m ./internal/....PHONYlist andhelpoutputUsage
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
go.modrequires 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.