-
Notifications
You must be signed in to change notification settings - Fork 898
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
Sporadic test failures with SupportsFeatureMixin #23152
Comments
cc @kbrock |
irb # not rails console
class A ; end # => nil
class B < A ; end #=> nil
Object.send(:remove_const, :B) #=> B
B # uninitialized constant B (NameError)
A.subclasses.first # => B
A.subclasses.reject! { |x| x.name == "B" }
A.subclasses.first # => B This was introduced to ruby 3.1, and the changes were incorporated in the rails 7.0 DependencyTracker. Only 1 spec is causing this issue: supports_feature_mixin_spec.rb:318 I'm looking through the ruby code to see if there is a way to call the internal of note, rspec has rspec/rspec-mocks#1568 which states the same problem. When I find a solution, I'll share with them. |
DescendantsTracker documents it, but doesn't really say if and when it will be used https://api.rubyonrails.org/classes/ActiveSupport/DescendantsTracker.html
|
Well, descendants_tracker.rb is pretty clear: module ActiveSupport
# This module provides an internal implementation to track descendants
# which is faster than iterating through ObjectSpace.
module DescendantsTracker
if RubyFeatures::CLASS_SUBCLASSES # RUBY_VERSION >= "3.1"
# [...]
class << self
#[...]
def subclasses(klass)
klass.subclasses
end
def descendants(klass) # think this is deprecated
klass.descendants
end
end
end
end
end |
I was getting sporadic results when calling I converted over to manually adding and removing the objects and even running these tests from pure ruby with no rails or miq patches in place. So my current solution is to change the temporary |
There appear to be some sporadic test failures between supports_feature_mixin_spec and a number of other specs which test
ExtManagementSystem
classes.All of these failures reference
ProviderA::ExtManagementSystem:Class
and I only seeProviderA
inspec/models/mixins/supports_feature_mixin_spec.rb
[ref]
The text was updated successfully, but these errors were encountered: