Skip to content

fix(ci): make race detection opt-out for pre-push hook#9003

Open
enxebre wants to merge 1 commit into
openshift:mainfrom
enxebre:remove-race-from-make-test
Open

fix(ci): make race detection opt-out for pre-push hook#9003
enxebre wants to merge 1 commit into
openshift:mainfrom
enxebre:remove-race-from-make-test

Conversation

@enxebre

@enxebre enxebre commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

  • Add GO_TEST_FLAGS variable to the Makefile (defaults to -race) so callers can opt out
  • Pre-push hook now passes GO_TEST_FLAGS= to skip race detection

Why

The race detector adds 2-10x overhead to test execution. On CI agent pods (currently 500m CPU, being bumped in openshift/release#81875), make test -race across 374 packages takes 30+ minutes and hits the 20-minute Bash tool timeout, causing pre-push hooks to fail with exit 143. This blocks all pushes from agent sessions.

Direct make test and CI sharded jobs keep -race by default — only the pre-push hook opts out for faster feedback.

Related

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Improved test command flexibility by allowing test flags to be configured.
    • Updated pre-push test checks to run faster without race detection by default.
    • Preserved race detection for standard test and CI workflows unless explicitly overridden.

Add GO_TEST_FLAGS variable (defaults to -race) so callers can
disable race detection when speed matters more than coverage.
The pre-push hook now passes GO_TEST_FLAGS= to skip -race,
which adds 2-10x overhead and causes hook timeouts on CI pods.

Direct `make test` and `make test-shard` keep -race by default.
CI sharded jobs in GitHub Actions also keep -race unchanged.

Tracks: CNTRLPLANE-3761

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: c353ccc9-0ddd-4f08-b5b3-fe91602b72ad

📥 Commits

Reviewing files that changed from the base of the PR and between a84834f and 39b2945.

📒 Files selected for processing (2)
  • .pre-commit-config.yaml
  • Makefile

📝 Walkthrough

Walkthrough

The Makefile introduces the configurable GO_TEST_FLAGS variable, defaulting to -race, and uses it for both test and test-shard. The local make-test pre-push hook sets GO_TEST_FLAGS= so tests run without race detection and updates its description accordingly.

Suggested reviewers: bryan-cox

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: disabling race detection for the pre-push hook while keeping it configurable.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The patch only changes .pre-commit-config.yaml and Makefile; no Ginkgo test titles or other test definitions were added or modified.
Test Structure And Quality ✅ Passed No Ginkgo test code changed; the PR only edits Makefile and pre-commit hook config.
Topology-Aware Scheduling Compatibility ✅ Passed Only .pre-commit-config.yaml and Makefile changed; no deployment manifests, operator code, or controllers were modified.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR only changes Makefile/pre-commit hook; no new Ginkgo e2e tests or network/IP logic were added, so the IPv6/disconnected check is not applicable.
No-Weak-Crypto ✅ Passed Only Makefile and pre-push hook test flags changed; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB or secret-compare code appears in the diff.
Container-Privileges ✅ Passed Only .pre-commit-config.yaml and Makefile changed; neither adds privileged/host* settings or any container manifest securityContext fields.
No-Sensitive-Data-In-Logs ✅ Passed Patch only changes test flags and hook descriptions; no new logging or sensitive values (passwords/tokens/PII) are introduced.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci openshift-ci Bot requested review from bryan-cox and ironcladlou July 14, 2026 15:02
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 14, 2026
@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.11%. Comparing base (a84834f) to head (39b2945).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9003   +/-   ##
=======================================
  Coverage   44.11%   44.11%           
=======================================
  Files         772      772           
  Lines       96109    96109           
=======================================
  Hits        42399    42399           
  Misses      50767    50767           
  Partials     2943     2943           
Flag Coverage Δ
cmd-support 38.28% <ø> (ø)
cpo-hostedcontrolplane 46.06% <ø> (ø)
cpo-other 45.16% <ø> (ø)
hypershift-operator 54.09% <ø> (ø)
other 32.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@bryan-cox

Copy link
Copy Markdown
Member

/area ci-tooling

@bryan-cox bryan-cox left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci Bot added area/ci-tooling Indicates the PR includes changes for CI or tooling and removed do-not-merge/needs-area labels Jul 14, 2026
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 14, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aks
/test e2e-aws
/test e2e-aws-upgrade-hypershift-operator
/test e2e-azure-v2-self-managed
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws
/test e2e-v2-gke

@openshift-ci

openshift-ci Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bryan-cox, enxebre

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@enxebre

enxebre commented Jul 14, 2026

Copy link
Copy Markdown
Member Author

/verified by @enxebre
/override "ci/prow/e2e-aks"
/override "ci/prow/e2e-aws"
/override "ci/prow/e2e-aws-upgrade-hypershift-operator"
/override "ci/prow/e2e-azure-v2-self-managed"
/override "ci/prow/e2e-kubevirt-aws-ovn-reduced"
/override "ci/prow/e2e-v2-aws"
/override "ci/prow/e2e-v2-gke"

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jul 14, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@enxebre: This PR has been marked as verified by @enxebre.

Details

In response to this:

/verified by @enxebre
/override "ci/prow/e2e-aks"
/override "ci/prow/e2e-aws"
/override "ci/prow/e2e-aws-upgrade-hypershift-operator"
/override "ci/prow/e2e-azure-v2-self-managed"
/override "ci/prow/e2e-kubevirt-aws-ovn-reduced"
/override "ci/prow/e2e-v2-aws"
/override "ci/prow/e2e-v2-gke"

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci

openshift-ci Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@enxebre: Overrode contexts on behalf of enxebre: ci/prow/e2e-aks, ci/prow/e2e-aws, ci/prow/e2e-aws-upgrade-hypershift-operator, ci/prow/e2e-azure-v2-self-managed, ci/prow/e2e-kubevirt-aws-ovn-reduced, ci/prow/e2e-v2-aws, ci/prow/e2e-v2-gke

Details

In response to this:

/verified by @enxebre
/override "ci/prow/e2e-aks"
/override "ci/prow/e2e-aws"
/override "ci/prow/e2e-aws-upgrade-hypershift-operator"
/override "ci/prow/e2e-azure-v2-self-managed"
/override "ci/prow/e2e-kubevirt-aws-ovn-reduced"
/override "ci/prow/e2e-v2-aws"
/override "ci/prow/e2e-v2-gke"

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@enxebre enxebre added the acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. label Jul 14, 2026
@cwbotbot

Copy link
Copy Markdown

Test Results

e2e-aws

Failed Tests

Total failed tests: 2

  • TestCreateClusterPrivateWithRouteKAS
  • TestCreateClusterPrivateWithRouteKAS/Teardown

e2e-aks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. approved Indicates a PR has been approved by an approver from all required OWNERS files. area/ci-tooling Indicates the PR includes changes for CI or tooling lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants