Skip to content

fix(make): don't let ambient RACE leak into raceEnabled test - #5152

Merged
wagoodman merged 1 commit into
mainfrom
fix/race-test-env-leak
Aug 5, 2026
Merged

fix(make): don't let ambient RACE leak into raceEnabled test#5152
wagoodman merged 1 commit into
mainfrom
fix/race-test-env-leak

Conversation

@wagoodman

Copy link
Copy Markdown
Contributor

The two "RACE is unset" cases in TestRaceEnabled only skipped the t.Setenv call, which means they picked up whatever RACE happened to be in the environment.

So running make test in a job that exports RACE=false broke the CI-default case, which wants the unset behavior (true). default locally passed by luck since it wants false anyway.

Now every case goes through t.Setenv (for the restore) and the unset cases explicitly os.Unsetenv. The flag itself was fine.

@wagoodman wagoodman added the changelog-ignore do not add a entry for this when generating the changelog label Aug 5, 2026
@oss-housekeeper oss-housekeeper Bot removed the changelog-ignore do not add a entry for this when generating the changelog label Aug 5, 2026
@wagoodman wagoodman added the changelog-ignore do not add a entry for this when generating the changelog label Aug 5, 2026
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
wagoodman force-pushed the fix/race-test-env-leak branch from af0dce5 to 863c15f Compare August 5, 2026 13:42
@oss-housekeeper oss-housekeeper Bot removed the changelog-ignore do not add a entry for this when generating the changelog label Aug 5, 2026
@wagoodman wagoodman added the changelog-ignore do not add a entry for this when generating the changelog label Aug 5, 2026
@wagoodman
wagoodman merged commit 68da404 into main Aug 5, 2026
15 checks passed
@wagoodman
wagoodman deleted the fix/race-test-env-leak branch August 5, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-ignore do not add a entry for this when generating the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant