fix(make): don't let ambient RACE leak into raceEnabled test - #5152
Merged
Conversation
The two "RACE is unset" cases only skipped the t.Setenv call, so they inherited whatever RACE was in the environment. Running `make test` with RACE=false exported job-wide flipped the CI-default case and failed. Signed-off-by: Alex Goodman <alex.goodman@anchore.com> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
wagoodman
force-pushed
the
fix/race-test-env-leak
branch
from
August 5, 2026 13:42
af0dce5 to
863c15f
Compare
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.
The two "RACE is unset" cases in
TestRaceEnabledonly skipped thet.Setenvcall, which means they picked up whateverRACEhappened to be in the environment.So running
make testin a job that exportsRACE=falsebroke the CI-default case, which wants the unset behavior (true).default locallypassed by luck since it wantsfalseanyway.Now every case goes through
t.Setenv(for the restore) and the unset cases explicitlyos.Unsetenv. The flag itself was fine.