Skip to content

fix: fal unit tests - #1216

Merged
badayvedat merged 6 commits into
mainfrom
vedat/plat-4617-fix-fal-unit-tests
Oct 13, 2026
Merged

badayvedat merged 6 commits into
mainfrom
vedat/plat-4617-fix-fal-unit-tests

Conversation

@badayvedat

@badayvedat badayvedat commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Note

Low Risk
Changes are mostly test harness and small resource-cleanup fixes; toolkit schema tweaks affect OpenAPI/JSON schema output but not runtime validation logic.

Overview
Hardens distributed workers and Pydantic toolkit types, while isolating and stabilizing the fal unit test suite.

In worker.py, submit() now closes the coroutine if scheduling fails (e.g. loop not running), avoiding leaked coroutines; shutdown() no-ops when already stopped so repeated shutdown is safe. In fal.toolkit.types, Pydantic v2 JSON schema hooks are fixed (@classmethod on __get_pydantic_json_schema__) and schema format is set via field_schema.update instead of removed update_not_none.

Test changes decouple unit runs from the developer’s local fal config: root conftest patches FAL_CONFIG_PATH when collecting only tests/unit, adds tests/unit/conftest.py autouse isolation, and moves GRPC/auth debug output to pytest_report_header with lazy imports. Deploy CLI tests use a cli_working_directory fixture instead of find_project_root. WMA tests get a shared _restore_aioice_close autouse fixture (removed from individual tests). New coverage covers worker submit/shutdown, toolkit JSON schema formats, and subprocess verification that unit collection ignores invalid local config.

Reviewed by Cursor Bugbot for commit 5a2901a. Bugbot is set up for automated code reviews on this repo. Configure here.

@linear-code

linear-code Bot commented Oct 13, 2026

Copy link
Copy Markdown

PLAT-4617

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good — straightforward bug fixes with matching tests.

What was reviewed: the DistributedWorker.submit/shutdown fix (closes unscheduled coroutines on failure, early-returns on repeated shutdown) and its new unit tests; the pydantic v2 fix in toolkit/types.py (dropped deprecated update_not_none for plain dict.update, added missing @ classmethod on __get_pydantic_json_schema__) and its new schema tests; and the test-isolation infrastructure (conftest changes preventing local FAL_CONFIG_PATH/FAL_PROFILE from leaking into unit tests, plus a cli_working_directory fixture replacing live filesystem lookups in deploy tests).

Extended reasoning...

Diff touches fal/distributed/worker.py (coroutine submission/shutdown lifecycle), fal/toolkit/types.py (pydantic v2 schema customization), and six test files; no auth/crypto/permission surface is touched. The two source fixes are small, mechanical, and verified correct by reading the full method bodies; test changes are internally consistent isolation/fixture work with no risky behavior. Size and clarity support approval without requiring a human look.

@badayvedat
badayvedat merged commit 799d592 into main Oct 13, 2026
17 of 31 checks passed
@badayvedat
badayvedat deleted the vedat/plat-4617-fix-fal-unit-tests branch October 13, 2026 11:37
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.

2 participants