Highlights
- First-class testing API —
TestServer runs a real pounce server in a background thread. Use it as a context manager, async context manager, or via the auto-registered pounce_server pytest fixture. Ephemeral port binding, .url property, and reliable startup synchronization out of the box.
- Graceful shutdown overhaul — Per-worker parallel joins, bounded executor teardown, and connection draining with 503 responses during shutdown.
- Thread-safety fixes — Connection counter is now atomic under
threading.Lock, and ASGI bridge header filtering is single-pass.
Added
pounce.testing.TestServer — real server for integration tests with context manager support
pounce.testing.serve() — async context manager helper
pounce_server pytest fixture — auto-registered via pytest11 entry point
Server.bound_addr — public property for bound (host, port) after startup
- Startup readiness synchronization for reliable test orchestration
Changed
- Graceful shutdown applies
shutdown_timeout per worker with parallel joins
- Worker executor teardown runs on a dedicated thread pool, wrapped in
asyncio.wait_for
- Log formatting respects
sys.stderr.isatty() for TTY detection
Fixed
- Thread-safe connection counter with
threading.Lock on Worker._active_connections
- Single-pass hop-by-hop header filter in ASGI bridge response path
Docs
- Synced README, ARD, FEATURES, PRD, and site pages with actual codebase
Install
uv add "bengal-pounce==0.4.0"