Skip to content

Commit

Permalink
ci: add go-test-32bit to catch atomic misalignment panics
Browse files Browse the repository at this point in the history
  • Loading branch information
dnephin committed Jun 28, 2021
1 parent 823c9ca commit 86a5aff
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,39 @@ jobs:
path: /tmp/jsonfile
- run: *notify-slack-failure

# go-test-32bit is to catch problems where 64-bit ints must be 64-bit aligned
# to use them with sync/atomic. See https://golang.org/pkg/sync/atomic/#pkg-note-BUG.
# Running tests with GOARCH=386 seems to be the best way to detect this
# problem. Only runs tests that are -short to limit the time we spend checking
# for these bugs.
go-test-32bit:
docker:
- image: *GOLANG_IMAGE
environment:
<<: *ENVIRONMENT
GOTAGS: "" # No tags for OSS but there are for enterprise
steps:
- checkout
- run: *install-gotestsum
- run: go mod download
- run:
name: go test 32-bit
command: |
mkdir -p $TEST_RESULTS_DIR /tmp/jsonfile
export GOARCH=386
go env
gotestsum \
--jsonfile /tmp/jsonfile/go-test-32bit.log \
--junitfile $TEST_RESULTS_DIR/gotestsum-report.xml -- \
-tags="$GOTAGS" -p 2 \
-short ./...
- store_test_results:
path: *TEST_RESULTS_DIR
- store_artifacts:
path: *TEST_RESULTS_DIR
- run: *notify-slack-failure

go-test-lib:
description: "test a library against a specific Go version"
parameters:
Expand Down Expand Up @@ -984,6 +1017,7 @@ workflows:
go-version: "1.15"
<<: *filter-ignore-non-go-branches
- go-test-race: *filter-ignore-non-go-branches
- go-test-32bit: *filter-ignore-non-go-branches
build-distros:
unless: << pipeline.parameters.trigger-load-test >>
jobs:
Expand Down

0 comments on commit 86a5aff

Please sign in to comment.