Skip to content

Commit

Permalink
Add .envrc file to set maximum number of test threads
Browse files Browse the repository at this point in the history
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 <[email protected]>
Co-authored-by: Matt Royal <[email protected]>
  • Loading branch information
njbennett and matt-royal committed Aug 24, 2020
1 parent ee681c6 commit df570cb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cores=$(/usr/sbin/sysctl -n hw.logicalcpu)

if (( cores > 8 )); then
# This environment variable overrides the `parallel_test` gem's default behavior
# which is to use all available logical cores.
# Running with 16 cores is very slow for reasons we don't fully understand
# but are probably due to lock file or disk resource contention

export PARALLEL_TEST_PROCESSORS=8
fi

0 comments on commit df570cb

Please sign in to comment.