Skip to content

fix(tests): clean up leaky global state from ActiveSupport - #3234

Open
solnic wants to merge 4 commits into
masterfrom
fix/rails-test-suite-activesupport-state-leak
Open

solnic wants to merge 4 commits into
masterfrom
fix/rails-test-suite-activesupport-state-leak

Conversation

@solnic

@solnic solnic commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

How about we make our test suite runs ~2x faster? 🙃

@solnic
solnic marked this pull request as ready for review November 23, 2026 20:29
@solnic
solnic requested a review from a team as a code owner November 23, 2026 20:29
…boot

Reset the ActiveRecord, Action Cable, route helper, cache and run-once load hook state that each booted test app leaves behind in cleanup!.
…constants

Move the global-state resets out of cleanup! into release_global_state,
mirroring restore_load_hook_state. Guard every reset on the constant or
setter existing so older Rails cells cannot fail every example in
cleanup!.

The Rails 6.1 and 7.0 cells were not run: they need Rubies that are not
installed here (only 3.4 and 4.0 are). Ruby 4.0 / Rails 8.1.3 shows the
same 7 pre-existing failures as before.

The reviewer's note on the lockfile edit was right: it was an unrelated
working-tree change, reverted rather than committed.
ActiveRecord::Base.filter_attributes does not exist on Rails 5.2, so the
spec raised NoMethodError on the Ruby 2.7 / Rails 5.2.0 cell. Skip it
there, matching the respond_to? guard in release_global_state.
@solnic
solnic force-pushed the fix/rails-test-suite-activesupport-state-leak branch from 081fc7e to a3f1427 Compare November 24, 2026 11:36
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.

1 participant