Avoid eagerly inspecting call traces in type assertions - #3073
Merged
Conversation
soutaro
force-pushed
the
codex/lazy-assert-send-type-message
branch
2 times, most recently
from
August 10, 2026 02:18
791275e to
9dddf8d
Compare
soutaro
enabled auto-merge
August 10, 2026 02:19
soutaro
force-pushed
the
codex/lazy-assert-send-type-message
branch
from
August 10, 2026 02:28
9dddf8d to
f1bcff3
Compare
soutaro
added a commit
that referenced
this pull request
Aug 10, 2026
Backport #3073 to 4.1: Avoid eagerly inspecting call traces in type assertions
Merged
Merged
soutaro
pushed a commit
that referenced
this pull request
Aug 23, 2026
`RBS::VERSION` becomes 4.2.0, `Gemfile.lock` is regenerated with the bump, and the 4.2.0.pre.1 section of CHANGELOG.md is replaced by the 4.2.0 section that folds it in. The changelog starts at `v4.1.2`, the latest release proper reachable from `master`: a release proper skips the prerelease tags, so everything written up under 4.2.0.pre.1 is in this section as well. #3074 and #3073 appear under 4.1.3 too, which backported them. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RBS::UnitTest::TypeAssertionseagerly interpolatestrace.inspectinto assertion messages, so the complete argument and return values are inspected even when the assertion succeeds.This is problematic for
ObjectSpace.reachable_objects_from_root: after the per-Ractor GC roots change in Ruby, the returned roots hash can be very large. Building its inspection string causes excessive peak memory usage and can raiseNoMemoryErrorin the Windowstest-bundled-gemsjob in ruby/ruby.Pass assertion messages as procs so call traces and method definitions are formatted only when an assertion fails. Apply the same lazy formatting to
assert_send_type,assert_send_type_error, andrefute_send_type.