fix: ProcessWorker now passes heartbeat_seconds to Runner
Regression from PR #19641 where heartbeats were moved from Runner to
flow engine. ProcessWorker was never updated to pass heartbeat_seconds
when creating its Runner, preventing flow heartbeats from being emitted.
The Runner needs heartbeat_seconds to set PREFECT_FLOWS_HEARTBEAT_FREQUENCY
in the subprocess environment, which the flow engine reads to emit heartbeats.
Changes:
- ProcessWorker.__aenter__ now reads flows.heartbeat_frequency from settings
and passes it to Runner
- Added regression test to verify ProcessWorker passes heartbeat_seconds
Fixes zombie flow detection false positives caused by missing heartbeats.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix flaky test: increase SQLite busy_timeout for test mode
The test_get_runs_in_queue_concurrency_limit_and_limit test was
intermittently failing with httpx.ReadError because the hosted API
server subprocess encountered SQLite lock contention during parallel
test execution (pytest-xdist). The 5-second busy_timeout in test mode
was insufficient, causing the server to fail and close the connection.
Remove the test-specific 5s busy_timeout and use the same 60s timeout
for all modes. This gives SQLite enough time to handle lock contention
during parallel test execution without significantly impacting test
performance.
Co-Authored-By: unknown <>
Fix `prefect deploy` stripping {{ ctx.flow.* }} templates from job variables
Add `skip_prefixes` parameter to `apply_values` so callers can preserve
specific placeholder namespaces during templating. The deploy CLI now
passes `skip_prefixes=["ctx."]` to the main `apply_values` call, which
keeps `{{ ctx.flow.name }}` and `{{ ctx.flow_run.name }}` intact while
still resolving build/push step outputs and warning on genuinely missing
placeholders.
Previously, `apply_values` with `remove_notset=True` (the default)
would either strip the key entirely or replace the placeholder with an
empty string, destroying templates that are meant to be resolved at flow
run time by the worker's `prepare_for_flow_run()` method.
https://claude.ai/code/session_01B1kqHx5JhKY4h6591TdvZA