haskell / haskell-language-server

Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Apache License 2.0
2.61k stars 351 forks source link

Flaky simple-multi-def-test on windows #4270

Open soulomoon opened 1 month ago

soulomoon commented 1 month ago

500 iterations successful in Macos But the test case is fairy broken on windows, expecially if the load is high. Only 6 iterations and I have the following error.

                             FAIL (50.62s)
        ghcide\test\exe\Config.hs:149:
        Expecting exactly one definition, got 0
soulomoon commented 1 month ago

Also sometime there is

FAIL (51.08s)
        ghcide\test\exe\CradleTests.hs:190:
        Got unexpected diagnostics for Uri {getUri = "file:///C:/Users/ares/AppData/Local/Temp/hls-test-root/extra-dir-855397965153/a/A.hs"} got [Diagnostic {_range = Range {_start = Position {_line = 0, _character = 0}, _end = Position {_line = 1, _character = 0}}, _severity = Just DiagnosticSeverity_Error, _code = Nothing, _codeDescription = Nothing, _source = Just "compiler", _message = "C:\\Users\\ares\\AppData\\Local\\Temp\\hls-test-root\\.cache\\ghcide\\a-1.0.0-inplace-31dd3c0e3611799597711e4d9677c41f678e7865\\ext2B3D: renameFile:renamePath:MoveFileEx \"\\\\\\\\?\\\\C:\\\\Users\\\\ares\\\\AppData\\\\Local\\\\Temp\\\\hls-test-root\\\\.cache\\\\ghcide\\\\a-1.0.0-inplace-31dd3c0e3611799597711e4d9677c41f678e7865\\\\ext2B3D\" Just \"\\\\\\\\?\\\\C:\\\\Users\\\\ares\\\\AppData\\\\Local\\\\Temp\\\\hls-test-root\\\\.cache\\\\ghcide\\\\a-1.0.0-inplace-31dd3c0e3611799597711e4d9677c41f678e7865\\\\A.hie\": permission denied (Access is denied.)", _tags = Nothing, _relatedInformation = Just [DiagnosticRelatedInformation {_location = Location {_uri = Uri {getUri = "file:///C:/Users/ares/AppData/Local/Temp/hls-test-root/extra-dir-855397965153/a/A.hs"}, _range = Range {_start = Position {_line = 0, _character = 0}, _end = Position {_line = 1, _character = 0}}}, _message = "GetModIfaceFromDisk"}], _data_ = Nothing}]

maybe related to https://github.com/dhall-lang/dhall-haskell/issues/1904 https://github.com/haskell/directory/issues/109 code in our code base https://github.com/haskell/haskell-language-server/blob/cec35a3baf48a8c120be1bee8a9aa302fd3df9ea/ghcide/src/Development/IDE/Core/Compile.hs#L822