Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.

Commit df570cb

Browse files
njbennettmatt-royal
andcommitted
Add .envrc file to set maximum number of test threads
We noticed that total test run time was much longer (30+ minutes vs. 10 minutes) on our new 16 logical core machines than our older 8 logical core machines. The tests seem to spend a long time starting parallel threads, either because the (many) `require` statements in the Rakefile take a long time when running many cores, or because they're waiting for a lockfile used by the `parallel` gem. Co-authored-by: Nat Bennett <nbennett@pivotal.io> Co-authored-by: Matt Royal <mroyal@pivotal.io>
1 parent ee681c6 commit df570cb

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.envrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
cores=$(/usr/sbin/sysctl -n hw.logicalcpu)
2+
3+
if (( cores > 8 )); then
4+
# This environment variable overrides the `parallel_test` gem's default behavior
5+
# which is to use all available logical cores.
6+
# Running with 16 cores is very slow for reasons we don't fully understand
7+
# but are probably due to lock file or disk resource contention
8+
9+
export PARALLEL_TEST_PROCESSORS=8
10+
fi

0 commit comments

Comments
 (0)