-
-
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
Running Rails test with Jruby 9000 #3364
Comments
I'm pretty new to JRuby so any help on how I can debug this issue would be great! 😄 |
Here is my test run output (I can see one stackoverflow at least):
|
I have reproduced the actionpack-related stack overflow here and will investigate. |
Full trace of stack overflow, at least at the point where it is recognized:
|
The overflow begins at the following point in the code, with the top frame getting duplicated as it continues to recurse back into itself:
|
Ok, so the class in question getting inherited called is an ActionPack::Metal instance with a prepended module that comes from this chunk in method_wrappers.rb: def deprecate_methods(target_module, *method_names)
options = method_names.extract_options!
deprecator = options.delete(:deprecator) || ActiveSupport::Deprecation.instance
method_names += options.keys
method_names.each do |method_name|
mod = Module.new do
define_method(method_name) do |*args, &block|
deprecator.deprecation_warning(method_name, options[method_name])
super(*args, &block)
end
end
target_module.prepend(mod)
end
end The inheritance change never gets out of the inherited method (below) because the super search appears to get stuck in the prepended module. def self.inherited(base) # :nodoc:
base.middleware_stack = middleware_stack.dup
super
end I suspect class super here is simply not handling prepended modules properly. |
Yep, that was it. I have a simple reproduction (below) and a fix coming. class A
def self.inherited(base)
super
end
end
A.singleton_class.prepend(Module.new)
class B < A; end |
Zing, it's fixed. ActionPack tests at least start running now, though they die out halfway through when an encoding error now. |
Added a related PR to Rails reducing the amount of prepending happening for that module_wrappers.rb that triggered this issue: rails/rails#21952 |
With my latest commit for Module#const_defined? and @headius fix above activesupport now is at: One big issue left for full rails 5 support is AR-JDBC is not providing some stuff which Rails AR wants but if I remove AR from the picture we boostrap now: |
To repro, just try to run the rails actionpcak test suite.
The text was updated successfully, but these errors were encountered: