vscode-coder
vscode-coder copied to clipboard
Test SSE connections are not leaked
Recently, we had an issue related to SSE connections leaked causing some overload in the API. It was fixed by https://github.com/coder/vscode-coder/pull/479, but we want to be sure this is not going to happen again. Since the test for this scenario is not trivial, we decided to create this follow-up issue.
After putting some thoughts on this, a good approach for testing could be having an integration test that would spin up a simple http server with an SSE endpoint, and use this custom streaming implementation to connect and disconnect the agent a few times, and see how many connections are still live. Keep in mind this is only one possibility, if you find a better, and easy way to test, please feel free to use it.
How relevant is this after https://github.com/coder/vscode-coder/pull/580 has landed? We do not use any SSEs now and rely solely on a one-way WebSocket connection which has a different life-cycle.