diff --git a/.github/workflows/test-build-deploy.yml b/.github/workflows/test-build-deploy.yml index 44e8d926289..5af0e5a5ffc 100644 --- a/.github/workflows/test-build-deploy.yml +++ b/.github/workflows/test-build-deploy.yml @@ -6,7 +6,8 @@ on: tags: - v[0-9]+.[0-9]+.[0-9]+** # Tag filters not as strict due to different regex system on Github Actions pull_request: - +env: + GOMAXPROCS: 1 jobs: lint: runs-on: ubuntu-20.04 @@ -54,7 +55,9 @@ jobs: mkdir -p /go/src/github.com/cortexproject/cortex ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex - name: Run Tests - run: make BUILD_IN_CONTAINER=false test + run: | + go run ./maxproc.go + make BUILD_IN_CONTAINER=false test security: name: CodeQL diff --git a/Makefile b/Makefile index 7c0c10a337d..dc60fb13afe 100644 --- a/Makefile +++ b/Makefile @@ -223,6 +223,7 @@ lint: ./pkg/ruler/... test: + go env go test -tags netgo -timeout 30m -race -count 1 ./... cover: diff --git a/maxproc.go b/maxproc.go new file mode 100644 index 00000000000..8fcef0891a1 --- /dev/null +++ b/maxproc.go @@ -0,0 +1,14 @@ +package main + +import ( + "fmt" + "runtime" +) + +func getGOMAXPROCS() int { + return runtime.GOMAXPROCS(0) +} + +func main() { + fmt.Printf("GOMAXPROCS is %d\n", getGOMAXPROCS()) +}