Skip to content

fix(make): always run unit tests with -race flag#4610

Merged
AustinAbro321 merged 2 commits intozarf-dev:mainfrom
soltysh:test_with_race
Feb 18, 2026
Merged

fix(make): always run unit tests with -race flag#4610
AustinAbro321 merged 2 commits intozarf-dev:mainfrom
soltysh:test_with_race

Conversation

@soltysh
Copy link
Copy Markdown
Contributor

@soltysh soltysh commented Feb 18, 2026

Description

Whenever running unit tests we should be using -race flag, to detect any race problems early on.

Related Issue

None

Checklist before merging

Signed-off-by: Maciej Szulik <maciej@defenseunicorns.com>
@soltysh soltysh requested review from a team as code owners February 18, 2026 13:42
@netlify
Copy link
Copy Markdown

netlify Bot commented Feb 18, 2026

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit 0004b30
🔍 Latest deploy log https://app.netlify.com/projects/zarf-docs/deploys/6995c8b1d996680008f32a64

Signed-off-by: Austin Abro <austinabro321@gmail.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 18, 2026

Codecov Report

❌ Patch coverage is 82.60870% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pkg/images/pull.go 66.66% 2 Missing and 1 partial ⚠️
src/pkg/images/push.go 92.85% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/pkg/images/push.go 49.30% <92.85%> (+0.71%) ⬆️
src/pkg/images/pull.go 52.61% <66.66%> (+0.39%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AustinAbro321 AustinAbro321 changed the title fix(make): make sure to always run tests with -race flag fix(make): always run unit tests with -race flag Feb 18, 2026
@soltysh
Copy link
Copy Markdown
Contributor Author

soltysh commented Feb 18, 2026

The 2nd commit (not mine) lgtm

Copy link
Copy Markdown
Member

@brandtkeller brandtkeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes lgtm.

Speaking out-loud to document my understanding AND the changes performed to resolve the race condition (for future reference):

  1. Move from a package level global http client to independent http clients per invocation removed the race to write .Transport
  2. The use of an outer-scoped err from goroutines is now shadowed with a goroutine-local :=.

We still have a few other violations of goroutine-local patterns but they are not race conditions so not pertinent to block.

@AustinAbro321 AustinAbro321 added this pull request to the merge queue Feb 18, 2026
Merged via the queue into zarf-dev:main with commit 76950b3 Feb 18, 2026
32 of 33 checks passed
@github-project-automation github-project-automation Bot moved this to Done in Zarf Feb 18, 2026
@soltysh soltysh deleted the test_with_race branch March 2, 2026 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants