-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
ObjectSpace is disabled; each_object will only work with Class #4619
Comments
I think the error message is actually quite clear. Without passing a flag, it works only with "Class", not "a class". This is because walking all classes in the system is easy:we start at BasicObject and walk every descendant, which eventually traverses all Class instances in the system. Perhaps we should put Class in quotes so it will be interpreted more literally. In any case, we will not be expanding that because there's no easy way to walk all heap objects on the JVM without switching to a debug mode. You'll need to pass the flag or find another way to accomplish what you are doing. Im happy to help with that. Why do you need to walk all IO in the system? |
Thanks for the quick reply and the offer to help. It's used to ensure that IOs are not being leaked. The exact code is here: https://github.com/socketry/async-rspec/blob/master/lib/async/rspec/leaks.rb If you have some ideas of a better way to do this, that would be awesome. Ideally, we don't need to supply Ruby specific flags to make this work. |
seems you're trying to solve IO-leaks in Ruby land ... that whole part is heavily MRI specific. |
I'm not trying to solve them, I'm trying to detect them. If the code being tested is leaking IO objects, it's something wrong with the design of the code. It's important to pick this up as soon as possible. This wasn't done until late in the game in |
@ioquatix yy - that's what I meant ... great that you had some success but on the JVM there's going to be potentially a lot of IOs outside of Ruby land (e.g. if there's an extension involved), even if you run with the |
We've added the appropriate env so object space continues to work. |
Environment
https://travis-ci.org/socketry/async-rspec/jobs/234686073
Expected Behavior
It should work.
Actual Behavior
It fails:
ObjectSpace is disabled; each_object will only work with Class, pass -X+O to enable
Either the error message is not clear - IO is a class, or something is wrong with JRuby.
What is the best way to make this work? Keep in mind, I need to run this in several different gems, so I'd like to avoid JRuby specific configuration in EVERY gem that's running on travis.
The text was updated successfully, but these errors were encountered: