Skip to content

Tests that are blocked for 3 second waitting for the server to exit  #4152

Closed
@soulomoon

Description

@soulomoon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: lspflaky testtype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions