Testing SSE in zig When EVERYTHING Blocks 0 ▲ hereticles 147 days ago · Tech · hide I rely on TDD heavily and really don’t like manual testing. So when I started building SSE support into mantel, I wanted a proper e2e test — connect a client, read the events, assert on them. Except, I ran into a problem. http.zig’s test helpers don’t work with SSE - they expect a request/response cycle that completes. And zig 0.16’s new Io framework supports neither cancellation nor non-blocking reads. So: everything blocks, and there’s no way to stop it. If I wasn’t building this because it’s fun, I’d probably skip it. Actually, I’d just use go where testing this is easy. I am not doing this for work, and this kind of “threading the needle” solution finding is something I enjoy. Plus, I am writing zig because I love it. I’d actually decided to let it be and moved on, but in my sleep, a solution came to me, and it worked. If We Could Cancel The normal testing pattern for this, for example in Go, would be something like: ``` - Set up the server - Connect the Client with a timeout -… Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town