Commits
Click on a commit to change the comparison rangeAdd in_process mode to prefect_test_harness to avoid VCR/httpcore hangs
When using prefect_test_harness with HTTP mocking libraries like VCR/vcrpy,
nested subflows can hang due to httpcore.PoolTimeout. This happens because
VCR wraps httpcore's connection handling and doesn't properly release
connections between subflows.
This adds an `in_process=True` option that runs the Prefect server in-process
using ASGI transport instead of starting a subprocess HTTP server. This
completely bypasses HTTP connection pooling, avoiding the VCR issue.
Historical context: The subprocess server was introduced in PR #14722 to
support WebSockets (required for events). The in-memory ASGI approach doesn't
support WebSockets, so this new option is opt-in for backwards compatibility.
The implementation uses a ContextVar to avoid backwards imports - testing
utilities import from client code, not vice versa.
Fixes: pydantic/pydantic-ai#3929
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>