Support re-entrant sessions that talk to the same server
In the Wingman test suite, I have 100+ golden tests. Currently, every one of them needs to spin up and subsequently tear down the server, which seems like a lot of wasted effort. I'd like to spin up a server before the first test runs, and have each test communicate with the same server.
I tried to roll my own, but running a Session is very opinionated about killing the server when it's done.
I think it's up to the test framework, whereas lsp-test can't do much. For your case, is it possible to spawn a worker thread with TQueue, executing Sessions sent from test cases?
In general, not spawn a new session for each test would make hls test suite lot faster :thinking:
@berberman AFAICT, the problem is that runSession explicitly asks the server to shut down when it's finished, which prevents users from working around this issue in application code
@isovector I came up with a naive implementation: https://github.com/haskell/haskell-language-server/compare/master...berberman:test-session-queue
But I didn't observe improvements running it locally, and it seemd that memory usage was even worse. Perhaps I missed something, or there is a leak.
Ahh, that's a clever solution; I completely misunderstood your suggestion. Sorry about that. I'll investigate tomorrow morning!