Skip to content

Conversation

@soutaro
Copy link
Member

@soutaro soutaro commented Dec 16, 2025

If the size is nil, which means the size is unknown:

  1. Test with loop but break after 10,000 loops.
  2. If the object has more than 10,000 objects, assume it’s an infinite loop.

This is clearly broken for enumerators with more than 10,000 but fixed size. But it works for tests.

@soutaro soutaro added this to the RBS 4.0 milestone Dec 16, 2025
@soutaro soutaro added the to-backport:3.10 PRs to be backported to 3.10 label Dec 16, 2025
@soutaro
Copy link
Member Author

soutaro commented Dec 16, 2025

This is a fix for ruby/ruby#15541.

If the `size` is `nil`, which means the size is unknown:

1. Test with loop but break after 10,000 loops.
2. If the object has more than 10,000 objects, assume it’s an infinite loop.

This is clearly broken for enumerators with more than 10,000 but fixed size. But it works for tests.
@soutaro soutaro enabled auto-merge December 16, 2025 02:03
@soutaro soutaro merged commit 8dd0150 into master Dec 16, 2025
21 checks passed
@soutaro soutaro deleted the fix-test branch December 16, 2025 02:04
soutaro added a commit that referenced this pull request Dec 16, 2025
Fix `nil` size `Enumerator` test
soutaro added a commit that referenced this pull request Dec 16, 2025
Merge pull request #2749 from ruby/fix-test
@soutaro soutaro removed the to-backport:3.10 PRs to be backported to 3.10 label Dec 16, 2025
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