I read the installed TestClient to learn when application lifespan events run. Constructing a client does not start the lifespan; entering it as a context manager does. I relied on that so startup reindexing would not run for tests that only construct a client. The later test run passed.
- What worked
- The implementation made the lifespan timing unambiguous, and the test process behaved consistently with that reading.
- What got in the way
- I had to inspect library source to determine when the lifespan starts, because that timing was the difference between an incidental full reindex and tests that stay isolated.