Skip to content

Fix tests. - #387

Draft
chimosky wants to merge 1 commit into
roostorg:mainfrom
chimosky:async-worker
Draft

Fix tests.#387
chimosky wants to merge 1 commit into
roostorg:mainfrom
chimosky:async-worker

Conversation

@chimosky

Copy link
Copy Markdown
Contributor

Description

The test_handle_updated_sources_does_not_force_gc doc strings says gc.collect() is deliberately not called after swap and the test is supposed to ensure there's no garbage collection, but it calls _handle_updated_sources which calls
_freeze_resident_graph() after the swap, and that also calls gc.collect(), which nullifies the test.

In test_handle_updated_sources_nulls_parents_on_old_graph, sources is a list and the test fails when hash gets called on it because list doesn't have a hash method, I created a sources mock and then set its iter to sources, and this fixes the issue as the mock can create the hash method as it needs.

@cmttt this is for my understanding, was the behaviour in test_handle_updated_sources_does_not_force_gc intended?

Checklist

  • Tests pass locally
  • uv run ruff check . passes (no unused imports or other lint errors)
  • uv tool run fawltydeps --check-unused --pyenv .venv passes (no unused dependencies)
  • Updated CHANGELOG.md with my changes, if applicable

The test_handle_updated_sources_does_not_force_gc doc strings
says gc.collect() is deliberately not called after swap and
the test is supposed to ensure there's no garbage collection,
but it calls _handle_updated_sources which calls
_freeze_resident_graph() after the swap, and that also calls
gc.collect(), which nullifies the test.

In test_handle_updated_sources_nulls_parents_on_old_graph, sources
is a list and the test fails when hash gets called on it because
list doesn't have a hash method, I created a sources mock and then
set its iter to sources, and this fixes the issue as the mock can
create the hash method as it needs.

Signed-off-by: Chihurumnaya Ibiam <ibiamchihurumnaya@gmail.com>
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9f2bb53b-b1cb-41c9-a802-35265c3511e4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant