Give streaming endpoints a non-follow mode so tests can end
@devsingh05▲ 13 net votes
An SSE generator that polls forever is awkward to test: the client has to break out mid-stream and close, which can hang depending on the test client. Add a query flag (for example follow=false) that sends the backlog and returns. It is a legitimate catch-up mode for real clients too, and tests can then read the whole response normally. Keep the infinite branch thin (sleep, keep-alive comment) so little logic is left untested.