Skip to content

Split heaviest bundler spec files for parallel execution - #9691

Merged
hsbt merged 3 commits into
masterfrom
claude/sleepy-gauss-c126f1
Jul 15, 2026
Merged

hsbt merged 3 commits into
masterfrom
claude/sleepy-gauss-c126f1

Conversation

@hsbt

@hsbt hsbt commented Jul 14, 2026

Copy link
Copy Markdown
Member

Parallel spec runs distribute work per file, so a single heavy file caps the achievable wall-clock time no matter how many workers are available. Per-file runtime measurements from Windows runs of make test-bundler-parallel show that spec/install/gemfile/git_spec.rb was by far the heaviest file at about 2500 example-seconds, and spec/commands/outdated_spec.rb, spec/commands/newgem_spec.rb and spec/commands/update_spec.rb each also exceed the ideal per-worker load of a 24-worker run. spec/runtime/setup_spec.rb dominates standalone runs of this repository, where it runs more examples than under ruby/ruby.

This splits each of these files at describe block boundaries, moving blocks verbatim. git_spec.rb becomes three files and the others two each. Example sets are unchanged, which was verified by comparing --dry-run example counts and full description sets before and after the split. newgem_spec.rb needed its shared examples moved together with their consumers and its top-level helpers duplicated into both files. All new files are registered in spec/support/shards.rb under the same shard as their original file, so shard balance is unchanged. A missing shard assignment for spec/bundler/plugin/unloaded_source_spec.rb, which warned on every run, is also fixed.

With these splits the largest remaining file drops from about 2500 to about 850 example-seconds (spec/commands/exec_spec.rb), which is below the ideal per-worker load of a 24-worker parallel run. Combined with the runtime-based grouping added in ruby/ruby#17647, this lowers the achievable wall-clock floor of make test-bundler-parallel to roughly the ideal per-worker load.

🤖 Generated with Claude Code

hsbt and others added 3 commits July 15, 2026 08:08
This was by far the heaviest bundler spec file (~2500 example-seconds
on Windows). Parallel spec runs distribute work per file, so a single
huge file caps the achievable wall-clock time. Move its describe
blocks verbatim into three files, keeping example count and structure
unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Its before(:context) shard warning fires on every run since the file
was added without a shards.rb entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Recorded per-file runtimes show outdated_spec.rb, newgem_spec.rb and
update_spec.rb each exceed the ideal per-worker load of a parallel
run, and setup_spec.rb dominates standalone runs, so file-based
distribution cannot go faster without splitting them. Blocks move
verbatim and example sets are unchanged. newgem's shared examples move
together with their consumers, with its top-level helpers duplicated
into both files.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 14, 2026 23:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves Bundler spec suite parallelism by splitting several “heavy” spec files into multiple smaller files (at describe boundaries) so parallel runners can distribute work more evenly. It also updates the shard mapping so the newly created spec files remain assigned to the same shards as their original files (preserving shard balance) and fixes a missing shard assignment warning.

Changes:

  • Split spec/runtime/setup_spec.rb into setup_spec.rb + setup_gems_spec.rb and register the new file in shards.
  • Split spec/install/gemfile/git_spec.rb into three files (git_spec.rb, git_overrides_spec.rb, git_extensions_spec.rb) and register new files in shards.
  • Split spec/commands/outdated_spec.rb, spec/commands/update_spec.rb, and spec/commands/newgem_spec.rb into additional companion files and register them in shards (also adding the previously-unassigned spec/bundler/plugin/unloaded_source_spec.rb).

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
spec/support/shards.rb Registers new split spec files into the existing shard buckets and adds a missing shard assignment.
spec/runtime/setup_spec.rb Removes the extracted “setup gems” examples so the remaining file is lighter for parallel runs.
spec/runtime/setup_gems_spec.rb New file containing extracted Bundler.setup gem/load-path/system-gems related examples.
spec/install/gemfile/git_spec.rb Removes extracted git override/extension/etc. sections so the remaining file is lighter.
spec/install/gemfile/git_overrides_spec.rb New file containing the extracted local override and related git-source scenarios.
spec/install/gemfile/git_extensions_spec.rb New file containing the extracted git-source extension and related scenarios.
spec/commands/outdated_spec.rb Removes extracted filter/deployment/multiplatform-related scenarios into a new file.
spec/commands/outdated_filters_spec.rb New file containing extracted bundle outdated filters/deployment/multiplatform scenarios.
spec/commands/update_spec.rb Removes extracted scenario-heavy bundle update specs into a new file.
spec/commands/update_scenarios_spec.rb New file containing extracted scenario-heavy bundle update specs.
spec/commands/newgem_spec.rb Reduced by moving option-focused specs to a new companion file.
spec/commands/newgem_options_spec.rb New file containing extracted option/config-matrix specs for bundle gem.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

expect(out).to eq("true\ntrue")
end

context "with bundler is located in symlinked GEM_HOME" do
Comment on lines +4 to +26
def gem_skeleton_assertions
expect(bundled_app("#{gem_name}/#{gem_name}.gemspec")).to exist
expect(bundled_app("#{gem_name}/README.md")).to exist
expect(bundled_app("#{gem_name}/Gemfile")).to exist
expect(bundled_app("#{gem_name}/Rakefile")).to exist
expect(bundled_app("#{gem_name}/lib/#{gem_name}.rb")).to exist
expect(bundled_app("#{gem_name}/lib/#{gem_name}/version.rb")).to exist

expect(ignore_paths).to include("bin/")
expect(ignore_paths).to include("Gemfile")
end

def bundle_exec_rubocop
prepare_gemspec(bundled_app(gem_name, "#{gem_name}.gemspec"))
bundle "config set path #{rubocop_gem_path}", dir: bundled_app(gem_name)
bundle "exec rubocop --debug --config .rubocop.yml", dir: bundled_app(gem_name)
end

def bundle_exec_standardrb
prepare_gemspec(bundled_app(gem_name, "#{gem_name}.gemspec"))
bundle "config set path #{standard_gem_path}", dir: bundled_app(gem_name)
bundle "exec standardrb --debug", dir: bundled_app(gem_name)
end
@hsbt
hsbt merged commit 3b0b3cc into master Jul 15, 2026
111 checks passed
@hsbt
hsbt deleted the claude/sleepy-gauss-c126f1 branch July 15, 2026 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants