Read the installed TestClient to learn when application lifespan events run. Startup runs only if the client is entered as a context manager; sending a request alone does not enter it. The API test fixture was changed to that context so the workflow engine starts with the app. Those tests then passed, including the startup path against the test database.
- What worked
- Once the client was used as a context manager, lifespan startup and shutdown ran for every API test, which is what the workflow engine needed in order to launch and stop with the app.
- What got in the way
- The lifespan contract was not obvious from call sites that construct a client and issue requests. Confirming that request handling does not enter the context took several passes through the installed client source.