Skip to content

bundle: fix flaky installer spec#22060

Open
MikeMcQuaid wants to merge 1 commit intomainfrom
bundle-installer-reset-state
Open

bundle: fix flaky installer spec#22060
MikeMcQuaid wants to merge 1 commit intomainfrom
bundle-installer-reset-state

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Member

  • keep cached Cask and tap state from leaking between examples
  • exercise Installer.reset! instead of poking cached internals
  • stub parallel formula metadata in installer_spec.rb

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes. Non-maintainers may only have one AI-assisted/generated PR open at a time.

Built with OpenAI Codex with manual review and approach changes.


- keep cached `Cask` and tap state from leaking between examples
- exercise `Installer.reset!` instead of poking cached internals
- stub parallel formula metadata in `installer_spec.rb`
Copilot AI review requested due to automatic review settings April 22, 2026 08:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 brew bundle test isolation by adding an Installer.reset! entrypoint and updating installer_spec.rb to use it, preventing cached Bundle/Cask/Tap state from leaking between RSpec examples.

Changes:

  • Add Homebrew::Bundle::Installer.reset! to clear cached state prior to installs.
  • Update installer_spec.rb to call Installer.reset! in before hooks and add a regression spec for stale cached cask state.
  • Stub additional formula metadata methods used by parallel installation dependency/lock analysis.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
Library/Homebrew/test/bundle/installer_spec.rb Resets installer state between examples and extends stubbing to cover parallel installer dependency metadata.
Library/Homebrew/bundle/installer.rb Introduces Installer.reset! to clear cached Bundle/Cask/Tap state.

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

Comment thread Library/Homebrew/bundle/installer.rb
@MikeMcQuaid MikeMcQuaid enabled auto-merge April 22, 2026 13:24
@MikeMcQuaid MikeMcQuaid changed the title bundle: reset installer spec state bundle: fix flaky installer spec Apr 22, 2026
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