Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable race detection for all amd64 and arm64 tests #16315

Closed
Tracked by #15951
jmhbnz opened this issue Jul 27, 2023 · 3 comments · Fixed by #16318
Closed
Tracked by #15951

Enable race detection for all amd64 and arm64 tests #16315

jmhbnz opened this issue Jul 27, 2023 · 3 comments · Fixed by #16318

Comments

@jmhbnz
Copy link
Member

jmhbnz commented Jul 27, 2023

What would you like to be added?

Sub issue under #15951.

Currently in main our scripts/test.sh logic disables golang test data race detector for all platforms except amd64, refer: https://github.com/etcd-io/etcd/blob/main/scripts/test.sh#L69-L78

# determine whether target supports race detection
if [ -z "${RACE:-}" ] ; then
  if [ "$GOARCH" == "amd64" ]; then
    RACE="--race"
  else
    RACE="--race=false"
  fi
else
  RACE="--race=${RACE:-true}"
fi

It's possible to override this with a command line param and our arm64 nightly tests do this for one specific test, refer: https://github.com/etcd-io/etcd/blob/main/.github/workflows/tests-arm64-template.yaml#L70

            linux-arm64-unit-4-cpu-race)
              GOOS=linux GOARCH=arm64 CPU=4 RACE=true ${{ inputs.unitTestCmd }}
            ;;

Where things get a little interesting is that for amd64, even though we enable race by default the way the workflow tests are defined it appears as though only one is intended to have race enabled?

Example - workflow file https://github.com/etcd-io/etcd/blob/main/.github/workflows/tests.yaml defines the following targets:

        target:
          - linux-amd64-integration-1-cpu
          - linux-amd64-integration-2-cpu
          - linux-amd64-integration-4-cpu
          - linux-amd64-unit-4-cpu-race
          - linux-386-unit-1-cpu

However if we look at any of the amd64 targets that don't include race in the name, they still operate with --race enabled, for example: https://github.com/etcd-io/etcd/actions/runs/5674542350/job/15378271400#step:5:113

I'm wondering if there is an opportunity to simplify the test runs and just enable race for both arm64 and amd64 for all test jobs?

Alternatively we should ensure race is only enabled for the jobs that specifically have race in the name.

Why is this needed?

Simplifying our use of --race for tests for amd64 and arm64 would simplify the code slightly.

Additionally doing this will help my cause in streamlining test commands between branches.

Currently this situation is creating minor test behavior difference between amd64 and arm64 that I would like to resolve.

@jmhbnz
Copy link
Member Author

jmhbnz commented Jul 27, 2023

@ahrtr, @serathius - I'm conscious I have little prior project background on why things might have ended up like I described above. Please let me know if I am missing anything before I press ahead with raising the pr, thanks 🙏🏻

@serathius
Copy link
Member

Sounds good, I think missing race is just a legacy reason.

@ahrtr
Copy link
Member

ahrtr commented Jul 27, 2023

It's possible to override this with a command line param and our arm64 nightly tests do this for one specific test

Agree. But based on my previous experience, enabling race on platform other than amd64 might cause the github workflow running for a very very long time. Please feel free to try it out.

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

Successfully merging a pull request may close this issue.

3 participants