Closed
Description
We have some tests that are blocked for 3 second waitting for the shutdown of the server.
https://github.com/soulomoon/haskell-language-server/blob/693f2a13fdc9319ed4f85d1ac7e2c45548888a29/hls-test-utils/src/Test/Hls.hs#L644-L645
For example in this test
https://github.com/soulomoon/haskell-language-server/blob/693f2a13fdc9319ed4f85d1ac7e2c45548888a29/plugins/hls-refactor-plugin/test/Main.hs#L80
we can see the bug:
cabal test haskell-language-server:test:hls-refactor-plugin-tests --test-options="-p /refactor/"
My guess is that
The SMethod_Shutdown is sent to the server at the end of runSessionWithHandles
It seems for this case the shutdown handler SMethod_Shutdown is not set up even after runSessionWithHandles is done.
I added a sleep 0.1 to the test to wait for the setup, then the server is closed as normal.