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

Fix memory leak for multiple runs in the same process #2987

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Commits on Dec 11, 2022

  1. Clear filtered_examples upon world reset

    The `RSpec::ExampleGroups.remove_all_constants` will unset the
    RSpec::Core::ExampleGroup subclass constants that where generated
    during a run, though the `@filtered_examples` hash's keys still
    reference them preventing them from being Garbage collected.
    iridakos committed Dec 11, 2022
    Configuration menu
    Copy the full SHA
    8777210 View commit details
    Browse the repository at this point in the history
  2. Clear RSpec::Core::AnonymousExampleGroup state upon world reset

    Examples that are added to the RSpec::Core::AnonymousExampleGroup upon
    their initialization (ex. RSpec::Core::SuiteHookContext) don't currently
    get cleared between runs.
    
    See RSpec::Core::Example#initialize
    iridakos committed Dec 11, 2022
    Configuration menu
    Copy the full SHA
    e402582 View commit details
    Browse the repository at this point in the history
  3. Clear non-main shared example groups upon world reset

    The RSpec::Core::SharedExampleGroup maintains references to
    RSpec::Core::ExampleGroup classes that were generated to previous
    runs preventing them to be garbage collected.
    iridakos committed Dec 11, 2022
    Configuration menu
    Copy the full SHA
    dbbe247 View commit details
    Browse the repository at this point in the history