-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix tests on Ruby 3 #87
Comments
It looks like the primary difference is that ruby 3 is actually exposing the C call frames in rb_profile_frames now. E.g. we are now seeing that calls to
These C frames are missing a file path. Since the normalization in the tests tries to expand the path as part of turning it into a relative path, it ends up expanding the empty path to a path to the current directory, resulting in differences like
|
I also noticed that the calls to initialize seem to be coming from a "new" with class_method_level "instance", which seemed strange. The |
We handle C frames different than Ruby ones (link). If Ruby 3 is now including the C frame in |
There is still a difference in that the C call has the caller at the top of the stack when the event hook is called. Perhaps that difference can be removed upstream, but it probably got introduced because it didn't matter in the context of Class#new is the defined method that gets called when it doesn't get overridden, so it is right from that perspective. It just is just wrong from the perspective of knowing that method is called on the receiver class (e.g. Example) |
This is also related to the fact that we were pulling together information from For example, when I run the script
it outputs
where you can see the inconsistency between it logging the Example.new class method being called, but logging it as an instance method when it is the caller. |
Until #87 is fixed, this gem produces unreliable results under Ruby 3.
See CI test failures (https://github.com/Shopify/rotoscope/runs/3954967334?check_suite_focus=true) from draft PR #86 changing CI to test on ruby 3
The text was updated successfully, but these errors were encountered: