From a87c918468aec76c242a5ec346f1141faa83ffe3 Mon Sep 17 00:00:00 2001 From: Charlie Le Date: Mon, 20 May 2024 16:10:44 -0700 Subject: [PATCH 1/5] Set GOMAXPROCS --- .github/workflows/test-build-deploy.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-build-deploy.yml b/.github/workflows/test-build-deploy.yml index 44e8d926289..663b942fc4d 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: 4 jobs: lint: runs-on: ubuntu-20.04 From a3f82b0afb89d3e3fe462af320ae508cd7a1a7b7 Mon Sep 17 00:00:00 2001 From: Charlie Le Date: Mon, 20 May 2024 16:20:43 -0700 Subject: [PATCH 2/5] Print go env Signed-off-by: Charlie Le --- .github/workflows/test-build-deploy.yml | 4 ++-- Makefile | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-build-deploy.yml b/.github/workflows/test-build-deploy.yml index 663b942fc4d..7003ac4f170 100644 --- a/.github/workflows/test-build-deploy.yml +++ b/.github/workflows/test-build-deploy.yml @@ -6,8 +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: 4 +#env: +# GOMAXPROCS: 4 jobs: lint: runs-on: ubuntu-20.04 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: From d5866dac88bb858071e8ecb7e433b6522869d2eb Mon Sep 17 00:00:00 2001 From: Charlie Le Date: Mon, 20 May 2024 16:26:38 -0700 Subject: [PATCH 3/5] Add maxproc printer --- .github/workflows/test-build-deploy.yml | 4 +++- maxproc.go | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 maxproc.go diff --git a/.github/workflows/test-build-deploy.yml b/.github/workflows/test-build-deploy.yml index 7003ac4f170..290b633d0c6 100644 --- a/.github/workflows/test-build-deploy.yml +++ b/.github/workflows/test-build-deploy.yml @@ -55,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/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()) +} From 52c46c2e140c25af61d76cf0c77c8ee7e9353fb3 Mon Sep 17 00:00:00 2001 From: Charlie Le Date: Mon, 20 May 2024 16:47:06 -0700 Subject: [PATCH 4/5] 2 maxproc --- .github/workflows/test-build-deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-build-deploy.yml b/.github/workflows/test-build-deploy.yml index 290b633d0c6..e35db9a1c66 100644 --- a/.github/workflows/test-build-deploy.yml +++ b/.github/workflows/test-build-deploy.yml @@ -6,8 +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: 4 +env: + GOMAXPROCS: 2 jobs: lint: runs-on: ubuntu-20.04 From 1b2b3aa57d92707e91bf9697be107aa6e6de947b Mon Sep 17 00:00:00 2001 From: Charlie Le <3375195+CharlieTLe@users.noreply.github.com> Date: Mon, 20 May 2024 17:56:30 -0700 Subject: [PATCH 5/5] Update test-build-deploy.yml --- .github/workflows/test-build-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build-deploy.yml b/.github/workflows/test-build-deploy.yml index e35db9a1c66..5af0e5a5ffc 100644 --- a/.github/workflows/test-build-deploy.yml +++ b/.github/workflows/test-build-deploy.yml @@ -7,7 +7,7 @@ on: - v[0-9]+.[0-9]+.[0-9]+** # Tag filters not as strict due to different regex system on Github Actions pull_request: env: - GOMAXPROCS: 2 + GOMAXPROCS: 1 jobs: lint: runs-on: ubuntu-20.04