Chore: Add warn in fal run if the app startup time exceeds startup timeout.#958
Chore: Add warn in fal run if the app startup time exceeds startup timeout.#958mittal-ishaan wants to merge 8 commits intomainfrom
fal run if the app startup time exceeds startup timeout.#958Conversation
ba0dcb9 to
3f1c4b7
Compare
fal run if the app startup time exceeds startup timeout.fal run if the app startup time exceeds startup timeout.
|
@claude review |
|
Claude finished @mittal-ishaan's task in 1m 34s —— View job Code Review
Overall the change is clean and well-tested. A few observations below.
|
There was a problem hiding this comment.
Pull request overview
This PR adds a warning mechanism to fal run to inform users when their application's setup time exceeds the configured startup timeout. This helps users catch performance issues early during local development that would later cause failures in production deployments.
Changes:
- Added a constant
DEFAULT_PLATFORM_STARTUP_TIMEOUT = 600seconds (10 minutes) as the default startup timeout when none is specified - Wrapped the
setup()function call in thelifespan()method with timing measurements usingtime.perf_counter() - Added logic to check if the measured setup time exceeds the effective startup timeout and print a warning message if it does
- Added comprehensive parametrized test
test_lifespan_startup_timeout_warningwith five test cases covering different timeout configurations and elapsed times
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| projects/fal/src/fal/app.py | Added startup timeout measurement and warning logic to the lifespan() method, with a new constant for the default platform timeout |
| projects/fal/tests/unit/test_app.py | Added parametrized test to verify warning behavior across different timeout and elapsed time combinations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
To check for startup timeout in

fal run, we wrap a timer around setup function and check how much time is it taking