File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
3+ require "etc"
34require "pathname"
45require "securerandom"
56require "shellwords"
@@ -37,7 +38,11 @@ multitask(:test) do
3738 ruby ( *%w[ -w -e ] , rb , verbose : false ) { fail unless _1 }
3839end
3940
40- xargs = %w[ xargs --no-run-if-empty --null --max-procs=0 --max-args=300 -- ]
41+ # Cap parallelism at the CPU count. `--max-procs=0` spawns one process per
42+ # 300-file batch with no upper bound; on large SDKs (thousands of files) that
43+ # oversubscribes CPUs and stacks up rubocop processes, exhausting memory and
44+ # slowing CI to the point of timing out.
45+ xargs = %W[ xargs --no-run-if-empty --null --max-procs=#{ Etc . nprocessors } --max-args=300 -- ]
4146ruby_opt = { "RUBYOPT" => [ ENV [ "RUBYOPT" ] , "--encoding=UTF-8" ] . compact . join ( " " ) }
4247
4348filtered = -> ( ext , dirs ) do
You can’t perform that action at this time.
0 commit comments