Skip to content

chore: Enable data race detection in argocd-agent 'dev-env' and E2E tests#793

Draft
jgwest wants to merge 1 commit intoargoproj-labs:mainfrom
jgwest:enable-data-race-detector-feb-2026
Draft

chore: Enable data race detection in argocd-agent 'dev-env' and E2E tests#793
jgwest wants to merge 1 commit intoargoproj-labs:mainfrom
jgwest:enable-data-race-detector-feb-2026

Conversation

@jgwest
Copy link
Member

@jgwest jgwest commented Mar 6, 2026

What does this PR do / why we need it:
We currently enable go data race detection for unit tests, and the E2E test portion of E2E tests, but NOT for the actual argocd agent binaries themselves when running E2E test. (The actual binaries are where we would expect most data races to occur)

This PR adds a new script which will wrap the 'go run' calls we use for executing agents (locally).

This script will:

  • Add '-race' parameter to 'go run' process for principal and managed/autonomous agent
  • Kill the go process when the first data race is detected from output (which should cause any running E2E tests to also fail)

I like this approach because it:

  • Works in dev-env mode, so as a developer I know when I have introduced a data race (the process will be killed, and the last message on the console will indicate the data race)
  • The data race detected message is not buried halfway up the logs
  • BUT I'm open to suggestions for other approaches: for example, we could instead ONLY enable data race for PR E2E tests, and only fail at the end of the test if a data race was detected.

NOTE: this PR is currently expected to fail due to existing data races in the code 😅 .

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 6, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f59ce25a-fc86-4874-b34f-0731e6b1711e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…ests

Signed-off-by: Jonathan West <jgwest@gmail.com>
@jgwest jgwest force-pushed the enable-data-race-detector-feb-2026 branch from d556a5d to 4f0d0b8 Compare March 6, 2026 13:16
@jgwest jgwest changed the title Enable data race detection in argocd-agent 'dev-env' and E2E tests chore: Enable data race detection in argocd-agent 'dev-env' and E2E tests Mar 6, 2026
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.71%. Comparing base (840b849) to head (4f0d0b8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #793      +/-   ##
==========================================
+ Coverage   47.68%   47.71%   +0.02%     
==========================================
  Files         104      104              
  Lines       13393    13393              
==========================================
+ Hits         6387     6391       +4     
+ Misses       6400     6395       -5     
- Partials      606      607       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jannfis
Copy link
Collaborator

jannfis commented Mar 6, 2026

Nice! I didn't even know it was possible to use the -race flag with go 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.

3 participants