Skip to content
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

core/class/descendants_spec relying on a particular GC behavior #903

Open
hmdne opened this issue Dec 8, 2021 · 1 comment
Open

core/class/descendants_spec relying on a particular GC behavior #903

hmdne opened this issue Dec 8, 2021 · 1 comment

Comments

@hmdne
Copy link

hmdne commented Dec 8, 2021

I'm implementing Class#{subclasses,descendants} in Opal. While in MRI GC may run quite consistently for this test to always pass, in Opal we have to rely on JS behavior - and it doesn't help us. A similar situation may happen on other Ruby implementations.

Let's take a look at this:

assert_descendants(ModuleSpecs::Parent, [ModuleSpecs::Child, ModuleSpecs::Child2, ModuleSpecs::Grandchild])

And then this:

child = Class.new(ModuleSpecs::Parent) do

A question would be - do we really want to hardcode a need for GC for this part or an assumption that it will be ran between those 2 tests?

@eregon
Copy link
Member

eregon commented Dec 8, 2021

Of course not, it's unintentional. Could you make a PR to fix it?
I think it's best to use a separate hierarchy for the descendants/subclasses specs to avoid unintentional subclasses like that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants