From b8ba1b593b3fb05c632affebcb832c46a1a24861 Mon Sep 17 00:00:00 2001 From: Spike Curtis Date: Wed, 16 Oct 2024 14:22:20 +0400 Subject: [PATCH] fix: reduce parallelism and increase worker size on go-test-race --- .github/workflows/ci.yaml | 8 ++++++-- Makefile | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9494a4d4d9c80..ece74b9d8f26c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -466,7 +466,7 @@ jobs: api-key: ${{ secrets.DATADOG_API_KEY }} test-go-race: - runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }} + runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }} needs: changes if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main' timeout-minutes: 25 @@ -487,9 +487,13 @@ jobs: - name: Setup Terraform uses: ./.github/actions/setup-tf + # We run race tests with reduced parallelism because they use more CPU and we were finding + # instances where tests appear to hang for multiple seconds, resulting in flaky tests when + # short timeouts are used. + # c.f. discussion on https://github.com/coder/coder/pull/15106 - name: Run Tests run: | - gotestsum --junitfile="gotests.xml" -- -race ./... + gotestsum --junitfile="gotests.xml" -- -race -parallel 4 -p 4 ./... - name: Upload test stats to Datadog timeout-minutes: 1 diff --git a/Makefile b/Makefile index 56664111f072c..084e8bb77e5f0 100644 --- a/Makefile +++ b/Makefile @@ -817,7 +817,7 @@ test-postgres-docker: # Make sure to keep this in sync with test-go-race from .github/workflows/ci.yaml. test-race: - $(GIT_FLAGS) gotestsum --junitfile="gotests.xml" -- -race -count=1 ./... + $(GIT_FLAGS) gotestsum --junitfile="gotests.xml" -- -race -count=1 -parallel 4 -p 4 ./... .PHONY: test-race test-tailnet-integration: