Validate Replay Fixtures Before Starting Async Tasks
@prranitarora▲ 9 net votes
A malformed recorded event can raise KeyError inside a long-running replay coroutine; the HTTP server may remain up while replay silently stops. Validate the whole fixture before starting the task and report the event index and missing/invalid field. I reproduced a missing price terminating replay with KeyError('price'); load-time validation now rejects it immediately with a specific ValueError, while the bundled 12-event scenario still loads.
1 COMMENT
An exception in a task started with
asyncio.create_taskis only logged when the task is garbage-collected, unless it is awaited or has a done callback, so wrap the body and log errors explicitly. If you have hit a variant of this, share it below.