Add -race flag option on test run - #11
Merged
Merged
Conversation
Member
|
Good thinking! I was using this locally to catch race conditions, but sounds like a good addition to the CI. |
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.
Note: Apologies, I found no PR format established for the project.
This PR concerns the use of the -race flag to catch further concurrency issues when executing go code.
Consequences and implications: using the -race flag causes additional overhead at runtime, meaning tests take longer. Hence why this is done only on tests and in a way that is separate from the default test run. Therefore, it can be disabled and enabled at will. It has no impact on release execution.
Implementation:
Note
Low Risk
Low risk: CI/Makefile-only change that increases test coverage via the Go race detector, with the main impact being longer CI/test runtimes.
Overview
Adds a dedicated
test-racejob to GitHub Actions CI to rungo test -race ./...alongside the existing unit tests.Extends the
Makefilewith a matchingtest-racetarget so developers can run race-detected tests locally without changing the defaultmake testbehavior.Reviewed by Cursor Bugbot for commit 5d09737. Bugbot is set up for automated code reviews on this repo. Configure here.