Skip to content

Commit 68675c3

Browse files
committed
Fix CircleCI OOM errors
1 parent e805045 commit 68675c3

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.circleci/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ commands:
8181
dockerize -wait tcp://localhost:6379 -timeout 1m
8282
- run:
8383
name: Run package tests
84+
environment:
85+
# When running on Docker in Circle, Go thinks there are 36 CPUs
86+
# which means the default number of parallel build processes will be 36
87+
# but using 36 build processes can lead to OOM errors
88+
# because according to https://circleci.com/docs/2.0/configuration-reference/#resource_class ,
89+
# the default Docker container only has 2 CPUs available.
90+
# That is why we explicitly specify -p=4 to reduce the number of parallel build processes
91+
GOFLAGS: -p=4
8492
command: ./support/scripts/run_tests
8593

8694
# build_packages creates the project's artifacts.

support/scripts/run_tests

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#! /bin/bash
22
set -e
33

4+
echo "using GOFLAGS=$GOFLAGS"
45
go test -race .
56
find . -maxdepth 1 -mindepth 1 -type d \
67
| egrep -v '^\.\/vendor|^.\/docs|^\.\/\..*' \

0 commit comments

Comments
 (0)