From 86a5affdb98be49d378c07cceadc02e4c3ee6891 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Mon, 28 Jun 2021 18:39:30 -0400 Subject: [PATCH] ci: add go-test-32bit to catch atomic misalignment panics --- .circleci/config.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index e553a8bb868d..c4da87df3fff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: @@ -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: