Skip to content

Some dhall-lsp-server tests are timing out #2454

@sjakobi

Description

@sjakobi

This has recently started happening in CI, starting with https://github.com/dhall-lang/dhall-haskell/actions/runs/3093604714.

I have also reproduced it locally with cabal test dhall-lsp-server:test:tests.

Luckily, on Windows, we get some output on the failures:

  Completion
    Dhall.Completion
      suggests user defined types:     FAIL (120.07s)
        uncaught exception: SessionException
        Timed out waiting to receive a message from the server.
        Last message received:
        {
            "jsonrpc": "2.0",
            "params": {
                "uri": "file:///D:/a/dhall-haskell/dhall-haskell/dhall-lsp-server/tests/fixtures/completion/CustomTypes.dhall",
                "diagnostics": [
                    {
                        "severity": 1,
                        "range": {
                            "start": {
                                "line": 2,
                                "character": 34
                            },
                            "end": {
                                "line": 2,
                                "character": 35
                            }
                        },
                        "source": "Dhall.TypeCheck",
                        "message": "Error: Unbound variable: C"
                    },
                    {
                        "severity": 4,
                        "range": {
                            "start": {
                                "line": 0,
                                "character": 13
                            },
                            "end": {
                                "line": 0,
                                "character": 43
                            }
                        },
                        "source": "Dhall.Lint",
                        "message": "Unused let binding 'Config'"
                    }
                ]
            },
            "method": "textDocument/publishDiagnostics"
        }
        Use -p '/suggests user defined types/' to rerun this test only.
      suggests user defined functions: FAIL (120.06s)
        uncaught exception: SessionException
        Timed out waiting to receive a message from the server.
        Last message received:
        {
            "jsonrpc": "2.0",
            "params": {
                "uri": "file:///D:/a/dhall-haskell/dhall-haskell/dhall-lsp-server/tests/fixtures/completion/CustomFunctions.dhall",
                "diagnostics": [
                    {
                        "severity": 1,
                        "range": {
                            "start": {
                                "line": 7,
                                "character": 0
                            },
                            "end": {
                                "line": 7,
                                "character": 0
                            }
                        },
                        "source": "Dhall.Parser",
                        "message": "unexpected end of input\nexpecting \"�\", ',', ->, :, ], or whitespace\n"
                    }
                ]
            },
            "method": "textDocument/publishDiagnostics"
        }
        Use -p '/suggests user defined functions/' to rerun this test only.
      suggests user defined bindings:  FAIL (120.06s)
        uncaught exception: SessionException
        Timed out waiting to receive a message from the server.
        Last message received:
        {
            "jsonrpc": "2.0",
            "params": {
                "uri": "file:///D:/a/dhall-haskell/dhall-haskell/dhall-lsp-server/tests/fixtures/completion/Bindings.dhall",
                "diagnostics": [
                    {
                        "severity": 1,
                        "range": {
                            "start": {
                                "line": 0,
                                "character": 57
                            },
                            "end": {
                                "line": 0,
                                "character": 59
                            }
                        },
                        "source": "Dhall.TypeCheck",
                        "message": "Error: Unbound variable: al"
                    },
                    {
                        "severity": 4,
                        "range": {
                            "start": {
                                "line": 0,
                                "character": 12
                            },
                            "end": {
                                "line": 0,
                                "character": 19
                            }
                        },
                        "source": "Dhall.Lint",
                        "message": "Unused let binding 'alice'"
                    }
                ]
            },
            "method": "textDocument/publishDiagnostics"
        }
        Use -p '/suggests user defined bindings/' to rerun this test only.

Here's the source for the failing tests:

it "suggests user defined types"
$ runSession "dhall-lsp-server" fullCaps fixtureDir
$ do
docId <- openDoc "CustomTypes.dhall" "dhall"
cs <- getCompletions docId (Position {_line = 2, _character = 35})
liftIO $ do
let firstItem = head cs
_label firstItem `shouldBe` "Config"
_detail firstItem `shouldBe` Just "Type"
it "suggests user defined functions"
$ runSession "dhall-lsp-server" fullCaps fixtureDir
$ do
docId <- openDoc "CustomFunctions.dhall" "dhall"
cs <- getCompletions docId (Position {_line = 6, _character = 7})
liftIO $ do
let firstItem = head cs
_label firstItem `shouldBe` "makeUser"
_detail firstItem `shouldBe` Just "\8704(user : Text) \8594 { home : Text }"
it "suggests user defined bindings"
$ runSession "dhall-lsp-server" fullCaps fixtureDir
$ do
docId <- openDoc "Bindings.dhall" "dhall"
cs <- getCompletions docId (Position {_line = 0, _character = 59})
liftIO $ do
let firstItem = head cs
_label firstItem `shouldBe` "bob"
_detail firstItem `shouldBe` Just "Text"

Metadata

Metadata

Assignees

No one assigned

    Labels

    LSPdhall-lsp-server

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions