Skip to content

Chore/1444 enable race detector make test#1494

Open
Oluwasuyi-Timilehin wants to merge 1 commit into
dotandev:mainfrom
Oluwasuyi-Timilehin:chore/1444-enable-race-detector-make-test
Open

Chore/1444 enable race detector make test#1494
Oluwasuyi-Timilehin wants to merge 1 commit into
dotandev:mainfrom
Oluwasuyi-Timilehin:chore/1444-enable-race-detector-make-test

Conversation

@Oluwasuyi-Timilehin

Copy link
Copy Markdown

#closes #1444

Title

fix(makefile): add -race flag to test target

Description

Adds the -race flag to the default make test target in the Makefile to enable Go's race detector during local development. This ensures developers can catch concurrency bugs locally before they reach CI, improving code quality and reducing feedback loops.

Related Issues

Closes #1444

Motivation

The default make test target was running go test ./... without the -race flag, meaning race detection only occurred in CI. This created a gap where developers could push code with race conditions that would only be caught after submission. By adding -race to the default test target, race detection runs locally during development, allowing developers to identify and fix concurrency issues before pushing.

Changes Made

  • Modified Makefile line 25
  • Changed go test ./... to go test -race ./...
  • No other files modified
  • No breaking changes

Testing

Verification Steps

  1. Verify the Makefile change

    cat Makefile | grep -A 1 "^test:"

    Expected output:

    test:
    	go test -race ./...
    
  2. Run the test target to confirm race detection is enabled

    make test
    • Tests should run with race detector active
    • If race conditions exist, they will be reported
    • If no races exist, tests should pass normally
  3. Verify race detector is active

    • The test output should include race detector warnings if any concurrency issues exist
    • You should see WARNING: DATA RACE messages if there are race conditions
    • The -race flag should be visible in the test command output
  4. Test with a specific package to confirm flag is being used

    go test -race ./...

    This should produce the same behavior as make test

  5. Run linting to ensure code quality

    make lint

Expected Behavior

  • All existing tests should continue to pass
  • Race detector should be active during test execution
  • Performance may be slightly slower (expected with race detector)
  • No functional changes to test logic

Checklist

  • Code follows style guidelines
  • Changes are minimal and focused
  • No breaking changes introduced
  • Documentation updated (this PR description)
  • Makefile modification is correct
  • Ready for local testing

Impact Assessment

Benefits

  • Developers catch race conditions locally before pushing
  • Reduces CI failures due to race conditions
  • Improves overall code quality
  • Aligns local development with CI expectations

Performance Considerations

  • Race detector adds ~10x slowdown to test execution (expected Go behavior)
  • This is acceptable for local development
  • Developers can still run go test ./... without -race if needed for faster iteration

Compatibility

  • No breaking changes
  • Backward compatible with all existing workflows
  • Only affects the default make test target
  • Developers can still run tests without race detector by using go test ./... directly

Additional Notes

  • This change aligns with Go best practices for concurrent code testing
  • The race detector is a standard Go tool for detecting data races
  • This is a simple, low-risk change with high value for code quality

#closes

@drips-wave

drips-wave Bot commented Jun 2, 2026

Copy link
Copy Markdown

@Oluwasuyi-Timilehin Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@dotandev

dotandev commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Fix conflicts and CI

@Oluwasuyi-Timilehin

Copy link
Copy Markdown
Author

@dotandev I already fixed conflict and CI

@Oluwasuyi-Timilehin Oluwasuyi-Timilehin force-pushed the chore/1444-enable-race-detector-make-test branch from 37a4725 to 374c320 Compare June 11, 2026 19:58
@Oluwasuyi-Timilehin

Copy link
Copy Markdown
Author

Hey @dotandev , I've completely cleaned up the git history for this branch so the diff is now clean and only contains the intended changes without any of the conflict artifacts. Could you please approve the workflows to run?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use go test -race in Makefile test target

2 participants