-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
Add specs for ractors access to module instance variables #1043
Add specs for ractors access to module instance variables #1043
Conversation
The specs for ObjectSpace._id2ref are failing because they behave differently in single vs multi ractor environments.
I have not been able to find a method in RubyLand(found rb_multi_ractor_p in the C code, but no way to use it in the ruby code) with which I can check whether we are in a multi ractor mode and AFAIK this is the only method which works differently even if not used in a ractor. This makes fixing these specs kinda funky, as I have a custom guard to check the ractor mode and then run appropriate specs in it. But, the only guard I can create, is trying this method and if it throws running the multi-ractor spec. But, that defeats the purpose of the spec since that is kinda what we want to test. Any suggestions on how I could approach this? |
f0bc41c
to
78bdf8f
Compare
Right. I think we should run the new specs in a subprocess then (via ruby_exe), which is how CRuby tests deal with this, no Ractor is created in the main test process. It is unfortunate. In general I'm hesitant whether we should add specs for Ractor given it's still quite unstable in CRuby and there seems to be no much point so far for other Rubies to support it (Threads are more general and faster). |
78bdf8f
to
13ef74a
Compare
Thanks a lot for letting me know about ruby_exe, really useful for this particular set of specs. I get your hesitation regarding ractors, but I think we should still have the specs here as ractors are a part of Ruby(however unstable and unused they may be for now 😅). |
Hey @eregon, are we planning to merge this one? |
I'm thinking to close it actually, sorry. First of all, having Ractor specs in language or core or library feels wrong. |
Oh that's fine. Thanks for the reasoning. |
Could you also update the related issue to avoid others working on it? |
Yes, I did that already and the same for 3.0, 3.1 and 3.2 issues. |
Awesome, thanks |
This PR adds specs for Feature #17592
From: